Debian Codegraph @

video/livestream/apiv1/auxiliary.go

raw symbols SCIP
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 livestream
18
19 import (
20 "context"
21 "time"
22
23 "cloud.google.com/go/longrunning"
24 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
25 livestreampb "cloud.google.com/go/video/livestream/apiv1/livestreampb"
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 // CreateAssetOperation manages a long-running operation from CreateAsset.
32 type CreateAssetOperation 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 *CreateAssetOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Asset, error) {
41 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
42 var resp livestreampb.Asset
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 *CreateAssetOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Asset, error) {
59 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
60 var resp livestreampb.Asset
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 *CreateAssetOperation) Metadata() (*livestreampb.OperationMetadata, error) {
75 var meta livestreampb.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 *CreateAssetOperation) 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 *CreateAssetOperation) Name() string {
92 return op.lro.Name()
93 }
94
95 // CreateChannelOperation manages a long-running operation from CreateChannel.
96 type CreateChannelOperation 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 *CreateChannelOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Channel, error) {
105 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
106 var resp livestreampb.Channel
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 *CreateChannelOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Channel, error) {
123 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
124 var resp livestreampb.Channel
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 *CreateChannelOperation) Metadata() (*livestreampb.OperationMetadata, error) {
139 var meta livestreampb.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 *CreateChannelOperation) 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 *CreateChannelOperation) Name() string {
156 return op.lro.Name()
157 }
158
159 // CreateClipOperation manages a long-running operation from CreateClip.
160 type CreateClipOperation 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 *CreateClipOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Clip, error) {
169 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
170 var resp livestreampb.Clip
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 *CreateClipOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Clip, error) {
187 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
188 var resp livestreampb.Clip
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 *CreateClipOperation) Metadata() (*livestreampb.OperationMetadata, error) {
203 var meta livestreampb.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 *CreateClipOperation) 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 *CreateClipOperation) Name() string {
220 return op.lro.Name()
221 }
222
223 // CreateDvrSessionOperation manages a long-running operation from CreateDvrSession.
224 type CreateDvrSessionOperation 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 *CreateDvrSessionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*livestreampb.DvrSession, error) {
233 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
234 var resp livestreampb.DvrSession
235 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
236 return nil, err
237 }
238 return &resp, nil
239 }
240
241 // Poll fetches the latest state of the long-running operation.
242 //
243 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
244 //
245 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
246 // the operation has completed with failure, the error is returned and op.Done will return true.
247 // If Poll succeeds and the operation has completed successfully,
248 // op.Done will return true, and the response of the operation is returned.
249 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
250 func (op *CreateDvrSessionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*livestreampb.DvrSession, error) {
251 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
252 var resp livestreampb.DvrSession
253 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
254 return nil, err
255 }
256 if !op.Done() {
257 return nil, nil
258 }
259 return &resp, nil
260 }
261
262 // Metadata returns metadata associated with the long-running operation.
263 // Metadata itself does not contact the server, but Poll does.
264 // To get the latest metadata, call this method after a successful call to Poll.
265 // If the metadata is not available, the returned metadata and error are both nil.
266 func (op *CreateDvrSessionOperation) Metadata() (*livestreampb.OperationMetadata, error) {
267 var meta livestreampb.OperationMetadata
268 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
269 return nil, nil
270 } else if err != nil {
271 return nil, err
272 }
273 return &meta, nil
274 }
275
276 // Done reports whether the long-running operation has completed.
277 func (op *CreateDvrSessionOperation) Done() bool {
278 return op.lro.Done()
279 }
280
281 // Name returns the name of the long-running operation.
282 // The name is assigned by the server and is unique within the service from which the operation is created.
283 func (op *CreateDvrSessionOperation) Name() string {
284 return op.lro.Name()
285 }
286
287 // CreateInputOperation manages a long-running operation from CreateInput.
288 type CreateInputOperation struct {
289 lro *longrunning.Operation
290 pollPath string
291 }
292
293 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
294 //
295 // See documentation of Poll for error-handling information.
296 func (op *CreateInputOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Input, error) {
297 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
298 var resp livestreampb.Input
299 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
300 return nil, err
301 }
302 return &resp, nil
303 }
304
305 // Poll fetches the latest state of the long-running operation.
306 //
307 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
308 //
309 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
310 // the operation has completed with failure, the error is returned and op.Done will return true.
311 // If Poll succeeds and the operation has completed successfully,
312 // op.Done will return true, and the response of the operation is returned.
313 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
314 func (op *CreateInputOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Input, error) {
315 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
316 var resp livestreampb.Input
317 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
318 return nil, err
319 }
320 if !op.Done() {
321 return nil, nil
322 }
323 return &resp, nil
324 }
325
326 // Metadata returns metadata associated with the long-running operation.
327 // Metadata itself does not contact the server, but Poll does.
328 // To get the latest metadata, call this method after a successful call to Poll.
329 // If the metadata is not available, the returned metadata and error are both nil.
330 func (op *CreateInputOperation) Metadata() (*livestreampb.OperationMetadata, error) {
331 var meta livestreampb.OperationMetadata
332 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
333 return nil, nil
334 } else if err != nil {
335 return nil, err
336 }
337 return &meta, nil
338 }
339
340 // Done reports whether the long-running operation has completed.
341 func (op *CreateInputOperation) Done() bool {
342 return op.lro.Done()
343 }
344
345 // Name returns the name of the long-running operation.
346 // The name is assigned by the server and is unique within the service from which the operation is created.
347 func (op *CreateInputOperation) Name() string {
348 return op.lro.Name()
349 }
350
351 // DeleteAssetOperation manages a long-running operation from DeleteAsset.
352 type DeleteAssetOperation struct {
353 lro *longrunning.Operation
354 pollPath string
355 }
356
357 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
358 //
359 // See documentation of Poll for error-handling information.
360 func (op *DeleteAssetOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
361 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
362 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
363 }
364
365 // Poll fetches the latest state of the long-running operation.
366 //
367 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
368 //
369 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
370 // the operation has completed with failure, the error is returned and op.Done will return true.
371 // If Poll succeeds and the operation has completed successfully,
372 // op.Done will return true, and the response of the operation is returned.
373 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
374 func (op *DeleteAssetOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
375 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
376 return op.lro.Poll(ctx, nil, opts...)
377 }
378
379 // Metadata returns metadata associated with the long-running operation.
380 // Metadata itself does not contact the server, but Poll does.
381 // To get the latest metadata, call this method after a successful call to Poll.
382 // If the metadata is not available, the returned metadata and error are both nil.
383 func (op *DeleteAssetOperation) Metadata() (*livestreampb.OperationMetadata, error) {
384 var meta livestreampb.OperationMetadata
385 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
386 return nil, nil
387 } else if err != nil {
388 return nil, err
389 }
390 return &meta, nil
391 }
392
393 // Done reports whether the long-running operation has completed.
394 func (op *DeleteAssetOperation) Done() bool {
395 return op.lro.Done()
396 }
397
398 // Name returns the name of the long-running operation.
399 // The name is assigned by the server and is unique within the service from which the operation is created.
400 func (op *DeleteAssetOperation) Name() string {
401 return op.lro.Name()
402 }
403
404 // DeleteChannelOperation manages a long-running operation from DeleteChannel.
405 type DeleteChannelOperation struct {
406 lro *longrunning.Operation
407 pollPath string
408 }
409
410 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
411 //
412 // See documentation of Poll for error-handling information.
413 func (op *DeleteChannelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
414 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
415 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
416 }
417
418 // Poll fetches the latest state of the long-running operation.
419 //
420 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
421 //
422 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
423 // the operation has completed with failure, the error is returned and op.Done will return true.
424 // If Poll succeeds and the operation has completed successfully,
425 // op.Done will return true, and the response of the operation is returned.
426 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
427 func (op *DeleteChannelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
428 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
429 return op.lro.Poll(ctx, nil, opts...)
430 }
431
432 // Metadata returns metadata associated with the long-running operation.
433 // Metadata itself does not contact the server, but Poll does.
434 // To get the latest metadata, call this method after a successful call to Poll.
435 // If the metadata is not available, the returned metadata and error are both nil.
436 func (op *DeleteChannelOperation) Metadata() (*livestreampb.OperationMetadata, error) {
437 var meta livestreampb.OperationMetadata
438 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
439 return nil, nil
440 } else if err != nil {
441 return nil, err
442 }
443 return &meta, nil
444 }
445
446 // Done reports whether the long-running operation has completed.
447 func (op *DeleteChannelOperation) Done() bool {
448 return op.lro.Done()
449 }
450
451 // Name returns the name of the long-running operation.
452 // The name is assigned by the server and is unique within the service from which the operation is created.
453 func (op *DeleteChannelOperation) Name() string {
454 return op.lro.Name()
455 }
456
457 // DeleteClipOperation manages a long-running operation from DeleteClip.
458 type DeleteClipOperation struct {
459 lro *longrunning.Operation
460 pollPath string
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 *DeleteClipOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
467 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
468 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
469 }
470
471 // Poll fetches the latest state of the long-running operation.
472 //
473 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
474 //
475 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
476 // the operation has completed with failure, the error is returned and op.Done will return true.
477 // If Poll succeeds and the operation has completed successfully,
478 // op.Done will return true, and the response of the operation is returned.
479 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
480 func (op *DeleteClipOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
481 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
482 return op.lro.Poll(ctx, nil, opts...)
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 *DeleteClipOperation) Metadata() (*livestreampb.OperationMetadata, error) {
490 var meta livestreampb.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 *DeleteClipOperation) 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 *DeleteClipOperation) Name() string {
507 return op.lro.Name()
508 }
509
510 // DeleteDvrSessionOperation manages a long-running operation from DeleteDvrSession.
511 type DeleteDvrSessionOperation 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 *DeleteDvrSessionOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
520 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
521 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
522 }
523
524 // Poll fetches the latest state of the long-running operation.
525 //
526 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
527 //
528 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
529 // the operation has completed with failure, the error is returned and op.Done will return true.
530 // If Poll succeeds and the operation has completed successfully,
531 // op.Done will return true, and the response of the operation is returned.
532 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
533 func (op *DeleteDvrSessionOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
534 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
535 return op.lro.Poll(ctx, nil, opts...)
536 }
537
538 // Metadata returns metadata associated with the long-running operation.
539 // Metadata itself does not contact the server, but Poll does.
540 // To get the latest metadata, call this method after a successful call to Poll.
541 // If the metadata is not available, the returned metadata and error are both nil.
542 func (op *DeleteDvrSessionOperation) Metadata() (*livestreampb.OperationMetadata, error) {
543 var meta livestreampb.OperationMetadata
544 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
545 return nil, nil
546 } else if err != nil {
547 return nil, err
548 }
549 return &meta, nil
550 }
551
552 // Done reports whether the long-running operation has completed.
553 func (op *DeleteDvrSessionOperation) Done() bool {
554 return op.lro.Done()
555 }
556
557 // Name returns the name of the long-running operation.
558 // The name is assigned by the server and is unique within the service from which the operation is created.
559 func (op *DeleteDvrSessionOperation) Name() string {
560 return op.lro.Name()
561 }
562
563 // DeleteInputOperation manages a long-running operation from DeleteInput.
564 type DeleteInputOperation struct {
565 lro *longrunning.Operation
566 pollPath string
567 }
568
569 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
570 //
571 // See documentation of Poll for error-handling information.
572 func (op *DeleteInputOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
573 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
574 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
575 }
576
577 // Poll fetches the latest state of the long-running operation.
578 //
579 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
580 //
581 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
582 // the operation has completed with failure, the error is returned and op.Done will return true.
583 // If Poll succeeds and the operation has completed successfully,
584 // op.Done will return true, and the response of the operation is returned.
585 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
586 func (op *DeleteInputOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
587 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
588 return op.lro.Poll(ctx, nil, opts...)
589 }
590
591 // Metadata returns metadata associated with the long-running operation.
592 // Metadata itself does not contact the server, but Poll does.
593 // To get the latest metadata, call this method after a successful call to Poll.
594 // If the metadata is not available, the returned metadata and error are both nil.
595 func (op *DeleteInputOperation) Metadata() (*livestreampb.OperationMetadata, error) {
596 var meta livestreampb.OperationMetadata
597 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
598 return nil, nil
599 } else if err != nil {
600 return nil, err
601 }
602 return &meta, nil
603 }
604
605 // Done reports whether the long-running operation has completed.
606 func (op *DeleteInputOperation) Done() bool {
607 return op.lro.Done()
608 }
609
610 // Name returns the name of the long-running operation.
611 // The name is assigned by the server and is unique within the service from which the operation is created.
612 func (op *DeleteInputOperation) Name() string {
613 return op.lro.Name()
614 }
615
616 // StartChannelOperation manages a long-running operation from StartChannel.
617 type StartChannelOperation struct {
618 lro *longrunning.Operation
619 pollPath string
620 }
621
622 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
623 //
624 // See documentation of Poll for error-handling information.
625 func (op *StartChannelOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*livestreampb.ChannelOperationResponse, error) {
626 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
627 var resp livestreampb.ChannelOperationResponse
628 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
629 return nil, err
630 }
631 return &resp, nil
632 }
633
634 // Poll fetches the latest state of the long-running operation.
635 //
636 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
637 //
638 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
639 // the operation has completed with failure, the error is returned and op.Done will return true.
640 // If Poll succeeds and the operation has completed successfully,
641 // op.Done will return true, and the response of the operation is returned.
642 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
643 func (op *StartChannelOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*livestreampb.ChannelOperationResponse, error) {
644 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
645 var resp livestreampb.ChannelOperationResponse
646 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
647 return nil, err
648 }
649 if !op.Done() {
650 return nil, nil
651 }
652 return &resp, nil
653 }
654
655 // Metadata returns metadata associated with the long-running operation.
656 // Metadata itself does not contact the server, but Poll does.
657 // To get the latest metadata, call this method after a successful call to Poll.
658 // If the metadata is not available, the returned metadata and error are both nil.
659 func (op *StartChannelOperation) Metadata() (*livestreampb.OperationMetadata, error) {
660 var meta livestreampb.OperationMetadata
661 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
662 return nil, nil
663 } else if err != nil {
664 return nil, err
665 }
666 return &meta, nil
667 }
668
669 // Done reports whether the long-running operation has completed.
670 func (op *StartChannelOperation) Done() bool {
671 return op.lro.Done()
672 }
673
674 // Name returns the name of the long-running operation.
675 // The name is assigned by the server and is unique within the service from which the operation is created.
676 func (op *StartChannelOperation) Name() string {
677 return op.lro.Name()
678 }
679
680 // StartDistributionOperation manages a long-running operation from StartDistribution.
681 type StartDistributionOperation struct {
682 lro *longrunning.Operation
683 pollPath string
684 }
685
686 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
687 //
688 // See documentation of Poll for error-handling information.
689 func (op *StartDistributionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*livestreampb.ChannelOperationResponse, error) {
690 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
691 var resp livestreampb.ChannelOperationResponse
692 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
693 return nil, err
694 }
695 return &resp, nil
696 }
697
698 // Poll fetches the latest state of the long-running operation.
699 //
700 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
701 //
702 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
703 // the operation has completed with failure, the error is returned and op.Done will return true.
704 // If Poll succeeds and the operation has completed successfully,
705 // op.Done will return true, and the response of the operation is returned.
706 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
707 func (op *StartDistributionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*livestreampb.ChannelOperationResponse, error) {
708 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
709 var resp livestreampb.ChannelOperationResponse
710 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
711 return nil, err
712 }
713 if !op.Done() {
714 return nil, nil
715 }
716 return &resp, nil
717 }
718
719 // Metadata returns metadata associated with the long-running operation.
720 // Metadata itself does not contact the server, but Poll does.
721 // To get the latest metadata, call this method after a successful call to Poll.
722 // If the metadata is not available, the returned metadata and error are both nil.
723 func (op *StartDistributionOperation) Metadata() (*livestreampb.OperationMetadata, error) {
724 var meta livestreampb.OperationMetadata
725 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
726 return nil, nil
727 } else if err != nil {
728 return nil, err
729 }
730 return &meta, nil
731 }
732
733 // Done reports whether the long-running operation has completed.
734 func (op *StartDistributionOperation) Done() bool {
735 return op.lro.Done()
736 }
737
738 // Name returns the name of the long-running operation.
739 // The name is assigned by the server and is unique within the service from which the operation is created.
740 func (op *StartDistributionOperation) Name() string {
741 return op.lro.Name()
742 }
743
744 // StopChannelOperation manages a long-running operation from StopChannel.
745 type StopChannelOperation struct {
746 lro *longrunning.Operation
747 pollPath string
748 }
749
750 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
751 //
752 // See documentation of Poll for error-handling information.
753 func (op *StopChannelOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*livestreampb.ChannelOperationResponse, error) {
754 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
755 var resp livestreampb.ChannelOperationResponse
756 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
757 return nil, err
758 }
759 return &resp, nil
760 }
761
762 // Poll fetches the latest state of the long-running operation.
763 //
764 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
765 //
766 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
767 // the operation has completed with failure, the error is returned and op.Done will return true.
768 // If Poll succeeds and the operation has completed successfully,
769 // op.Done will return true, and the response of the operation is returned.
770 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
771 func (op *StopChannelOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*livestreampb.ChannelOperationResponse, error) {
772 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
773 var resp livestreampb.ChannelOperationResponse
774 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
775 return nil, err
776 }
777 if !op.Done() {
778 return nil, nil
779 }
780 return &resp, nil
781 }
782
783 // Metadata returns metadata associated with the long-running operation.
784 // Metadata itself does not contact the server, but Poll does.
785 // To get the latest metadata, call this method after a successful call to Poll.
786 // If the metadata is not available, the returned metadata and error are both nil.
787 func (op *StopChannelOperation) Metadata() (*livestreampb.OperationMetadata, error) {
788 var meta livestreampb.OperationMetadata
789 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
790 return nil, nil
791 } else if err != nil {
792 return nil, err
793 }
794 return &meta, nil
795 }
796
797 // Done reports whether the long-running operation has completed.
798 func (op *StopChannelOperation) Done() bool {
799 return op.lro.Done()
800 }
801
802 // Name returns the name of the long-running operation.
803 // The name is assigned by the server and is unique within the service from which the operation is created.
804 func (op *StopChannelOperation) Name() string {
805 return op.lro.Name()
806 }
807
808 // StopDistributionOperation manages a long-running operation from StopDistribution.
809 type StopDistributionOperation struct {
810 lro *longrunning.Operation
811 pollPath string
812 }
813
814 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
815 //
816 // See documentation of Poll for error-handling information.
817 func (op *StopDistributionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*livestreampb.ChannelOperationResponse, error) {
818 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
819 var resp livestreampb.ChannelOperationResponse
820 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
821 return nil, err
822 }
823 return &resp, nil
824 }
825
826 // Poll fetches the latest state of the long-running operation.
827 //
828 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
829 //
830 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
831 // the operation has completed with failure, the error is returned and op.Done will return true.
832 // If Poll succeeds and the operation has completed successfully,
833 // op.Done will return true, and the response of the operation is returned.
834 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
835 func (op *StopDistributionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*livestreampb.ChannelOperationResponse, error) {
836 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
837 var resp livestreampb.ChannelOperationResponse
838 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
839 return nil, err
840 }
841 if !op.Done() {
842 return nil, nil
843 }
844 return &resp, nil
845 }
846
847 // Metadata returns metadata associated with the long-running operation.
848 // Metadata itself does not contact the server, but Poll does.
849 // To get the latest metadata, call this method after a successful call to Poll.
850 // If the metadata is not available, the returned metadata and error are both nil.
851 func (op *StopDistributionOperation) Metadata() (*livestreampb.OperationMetadata, error) {
852 var meta livestreampb.OperationMetadata
853 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
854 return nil, nil
855 } else if err != nil {
856 return nil, err
857 }
858 return &meta, nil
859 }
860
861 // Done reports whether the long-running operation has completed.
862 func (op *StopDistributionOperation) Done() bool {
863 return op.lro.Done()
864 }
865
866 // Name returns the name of the long-running operation.
867 // The name is assigned by the server and is unique within the service from which the operation is created.
868 func (op *StopDistributionOperation) Name() string {
869 return op.lro.Name()
870 }
871
872 // UpdateChannelOperation manages a long-running operation from UpdateChannel.
873 type UpdateChannelOperation struct {
874 lro *longrunning.Operation
875 pollPath string
876 }
877
878 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
879 //
880 // See documentation of Poll for error-handling information.
881 func (op *UpdateChannelOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Channel, error) {
882 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
883 var resp livestreampb.Channel
884 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
885 return nil, err
886 }
887 return &resp, nil
888 }
889
890 // Poll fetches the latest state of the long-running operation.
891 //
892 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
893 //
894 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
895 // the operation has completed with failure, the error is returned and op.Done will return true.
896 // If Poll succeeds and the operation has completed successfully,
897 // op.Done will return true, and the response of the operation is returned.
898 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
899 func (op *UpdateChannelOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Channel, error) {
900 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
901 var resp livestreampb.Channel
902 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
903 return nil, err
904 }
905 if !op.Done() {
906 return nil, nil
907 }
908 return &resp, nil
909 }
910
911 // Metadata returns metadata associated with the long-running operation.
912 // Metadata itself does not contact the server, but Poll does.
913 // To get the latest metadata, call this method after a successful call to Poll.
914 // If the metadata is not available, the returned metadata and error are both nil.
915 func (op *UpdateChannelOperation) Metadata() (*livestreampb.OperationMetadata, error) {
916 var meta livestreampb.OperationMetadata
917 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
918 return nil, nil
919 } else if err != nil {
920 return nil, err
921 }
922 return &meta, nil
923 }
924
925 // Done reports whether the long-running operation has completed.
926 func (op *UpdateChannelOperation) Done() bool {
927 return op.lro.Done()
928 }
929
930 // Name returns the name of the long-running operation.
931 // The name is assigned by the server and is unique within the service from which the operation is created.
932 func (op *UpdateChannelOperation) Name() string {
933 return op.lro.Name()
934 }
935
936 // UpdateDvrSessionOperation manages a long-running operation from UpdateDvrSession.
937 type UpdateDvrSessionOperation struct {
938 lro *longrunning.Operation
939 pollPath string
940 }
941
942 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
943 //
944 // See documentation of Poll for error-handling information.
945 func (op *UpdateDvrSessionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*livestreampb.DvrSession, error) {
946 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
947 var resp livestreampb.DvrSession
948 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
949 return nil, err
950 }
951 return &resp, nil
952 }
953
954 // Poll fetches the latest state of the long-running operation.
955 //
956 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
957 //
958 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
959 // the operation has completed with failure, the error is returned and op.Done will return true.
960 // If Poll succeeds and the operation has completed successfully,
961 // op.Done will return true, and the response of the operation is returned.
962 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
963 func (op *UpdateDvrSessionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*livestreampb.DvrSession, error) {
964 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
965 var resp livestreampb.DvrSession
966 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
967 return nil, err
968 }
969 if !op.Done() {
970 return nil, nil
971 }
972 return &resp, nil
973 }
974
975 // Metadata returns metadata associated with the long-running operation.
976 // Metadata itself does not contact the server, but Poll does.
977 // To get the latest metadata, call this method after a successful call to Poll.
978 // If the metadata is not available, the returned metadata and error are both nil.
979 func (op *UpdateDvrSessionOperation) Metadata() (*livestreampb.OperationMetadata, error) {
980 var meta livestreampb.OperationMetadata
981 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
982 return nil, nil
983 } else if err != nil {
984 return nil, err
985 }
986 return &meta, nil
987 }
988
989 // Done reports whether the long-running operation has completed.
990 func (op *UpdateDvrSessionOperation) Done() bool {
991 return op.lro.Done()
992 }
993
994 // Name returns the name of the long-running operation.
995 // The name is assigned by the server and is unique within the service from which the operation is created.
996 func (op *UpdateDvrSessionOperation) Name() string {
997 return op.lro.Name()
998 }
999
1000 // UpdateInputOperation manages a long-running operation from UpdateInput.
1001 type UpdateInputOperation struct {
1002 lro *longrunning.Operation
1003 pollPath string
1004 }
1005
1006 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
1007 //
1008 // See documentation of Poll for error-handling information.
1009 func (op *UpdateInputOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Input, error) {
1010 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
1011 var resp livestreampb.Input
1012 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
1013 return nil, err
1014 }
1015 return &resp, nil
1016 }
1017
1018 // Poll fetches the latest state of the long-running operation.
1019 //
1020 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
1021 //
1022 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
1023 // the operation has completed with failure, the error is returned and op.Done will return true.
1024 // If Poll succeeds and the operation has completed successfully,
1025 // op.Done will return true, and the response of the operation is returned.
1026 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
1027 func (op *UpdateInputOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Input, error) {
1028 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
1029 var resp livestreampb.Input
1030 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
1031 return nil, err
1032 }
1033 if !op.Done() {
1034 return nil, nil
1035 }
1036 return &resp, nil
1037 }
1038
1039 // Metadata returns metadata associated with the long-running operation.
1040 // Metadata itself does not contact the server, but Poll does.
1041 // To get the latest metadata, call this method after a successful call to Poll.
1042 // If the metadata is not available, the returned metadata and error are both nil.
1043 func (op *UpdateInputOperation) Metadata() (*livestreampb.OperationMetadata, error) {
1044 var meta livestreampb.OperationMetadata
1045 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
1046 return nil, nil
1047 } else if err != nil {
1048 return nil, err
1049 }
1050 return &meta, nil
1051 }
1052
1053 // Done reports whether the long-running operation has completed.
1054 func (op *UpdateInputOperation) Done() bool {
1055 return op.lro.Done()
1056 }
1057
1058 // Name returns the name of the long-running operation.
1059 // The name is assigned by the server and is unique within the service from which the operation is created.
1060 func (op *UpdateInputOperation) Name() string {
1061 return op.lro.Name()
1062 }
1063
1064 // UpdatePoolOperation manages a long-running operation from UpdatePool.
1065 type UpdatePoolOperation struct {
1066 lro *longrunning.Operation
1067 pollPath string
1068 }
1069
1070 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
1071 //
1072 // See documentation of Poll for error-handling information.
1073 func (op *UpdatePoolOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Pool, error) {
1074 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
1075 var resp livestreampb.Pool
1076 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
1077 return nil, err
1078 }
1079 return &resp, nil
1080 }
1081
1082 // Poll fetches the latest state of the long-running operation.
1083 //
1084 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
1085 //
1086 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
1087 // the operation has completed with failure, the error is returned and op.Done will return true.
1088 // If Poll succeeds and the operation has completed successfully,
1089 // op.Done will return true, and the response of the operation is returned.
1090 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
1091 func (op *UpdatePoolOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*livestreampb.Pool, error) {
1092 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
1093 var resp livestreampb.Pool
1094 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
1095 return nil, err
1096 }
1097 if !op.Done() {
1098 return nil, nil
1099 }
1100 return &resp, nil
1101 }
1102
1103 // Metadata returns metadata associated with the long-running operation.
1104 // Metadata itself does not contact the server, but Poll does.
1105 // To get the latest metadata, call this method after a successful call to Poll.
1106 // If the metadata is not available, the returned metadata and error are both nil.
1107 func (op *UpdatePoolOperation) Metadata() (*livestreampb.OperationMetadata, error) {
1108 var meta livestreampb.OperationMetadata
1109 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
1110 return nil, nil
1111 } else if err != nil {
1112 return nil, err
1113 }
1114 return &meta, nil
1115 }
1116
1117 // Done reports whether the long-running operation has completed.
1118 func (op *UpdatePoolOperation) Done() bool {
1119 return op.lro.Done()
1120 }
1121
1122 // Name returns the name of the long-running operation.
1123 // The name is assigned by the server and is unique within the service from which the operation is created.
1124 func (op *UpdatePoolOperation) Name() string {
1125 return op.lro.Name()
1126 }
1127
1128 // AssetIterator manages a stream of *livestreampb.Asset.
1129 type AssetIterator struct {
1130 items []*livestreampb.Asset
1131 pageInfo *iterator.PageInfo
1132 nextFunc func() error
1133
1134 // Response is the raw response for the current page.
1135 // It must be cast to the RPC response type.
1136 // Calling Next() or InternalFetch() updates this value.
1137 Response interface{}
1138
1139 // InternalFetch is for use by the Google Cloud Libraries only.
1140 // It is not part of the stable interface of this package.
1141 //
1142 // InternalFetch returns results from a single call to the underlying RPC.
1143 // The number of results is no greater than pageSize.
1144 // If there are no more results, nextPageToken is empty and err is nil.
1145 InternalFetch func(pageSize int, pageToken string) (results []*livestreampb.Asset, nextPageToken string, err error)
1146 }
1147
1148 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1149 func (it *AssetIterator) PageInfo() *iterator.PageInfo {
1150 return it.pageInfo
1151 }
1152
1153 // Next returns the next result. Its second return value is iterator.Done if there are no more
1154 // results. Once Next returns Done, all subsequent calls will return Done.
1155 func (it *AssetIterator) Next() (*livestreampb.Asset, error) {
1156 var item *livestreampb.Asset
1157 if err := it.nextFunc(); err != nil {
1158 return item, err
1159 }
1160 item = it.items[0]
1161 it.items = it.items[1:]
1162 return item, nil
1163 }
1164
1165 func (it *AssetIterator) bufLen() int {
1166 return len(it.items)
1167 }
1168
1169 func (it *AssetIterator) takeBuf() interface{} {
1170 b := it.items
1171 it.items = nil
1172 return b
1173 }
1174
1175 // ChannelIterator manages a stream of *livestreampb.Channel.
1176 type ChannelIterator struct {
1177 items []*livestreampb.Channel
1178 pageInfo *iterator.PageInfo
1179 nextFunc func() error
1180
1181 // Response is the raw response for the current page.
1182 // It must be cast to the RPC response type.
1183 // Calling Next() or InternalFetch() updates this value.
1184 Response interface{}
1185
1186 // InternalFetch is for use by the Google Cloud Libraries only.
1187 // It is not part of the stable interface of this package.
1188 //
1189 // InternalFetch returns results from a single call to the underlying RPC.
1190 // The number of results is no greater than pageSize.
1191 // If there are no more results, nextPageToken is empty and err is nil.
1192 InternalFetch func(pageSize int, pageToken string) (results []*livestreampb.Channel, nextPageToken string, err error)
1193 }
1194
1195 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1196 func (it *ChannelIterator) PageInfo() *iterator.PageInfo {
1197 return it.pageInfo
1198 }
1199
1200 // Next returns the next result. Its second return value is iterator.Done if there are no more
1201 // results. Once Next returns Done, all subsequent calls will return Done.
1202 func (it *ChannelIterator) Next() (*livestreampb.Channel, error) {
1203 var item *livestreampb.Channel
1204 if err := it.nextFunc(); err != nil {
1205 return item, err
1206 }
1207 item = it.items[0]
1208 it.items = it.items[1:]
1209 return item, nil
1210 }
1211
1212 func (it *ChannelIterator) bufLen() int {
1213 return len(it.items)
1214 }
1215
1216 func (it *ChannelIterator) takeBuf() interface{} {
1217 b := it.items
1218 it.items = nil
1219 return b
1220 }
1221
1222 // ClipIterator manages a stream of *livestreampb.Clip.
1223 type ClipIterator struct {
1224 items []*livestreampb.Clip
1225 pageInfo *iterator.PageInfo
1226 nextFunc func() error
1227
1228 // Response is the raw response for the current page.
1229 // It must be cast to the RPC response type.
1230 // Calling Next() or InternalFetch() updates this value.
1231 Response interface{}
1232
1233 // InternalFetch is for use by the Google Cloud Libraries only.
1234 // It is not part of the stable interface of this package.
1235 //
1236 // InternalFetch returns results from a single call to the underlying RPC.
1237 // The number of results is no greater than pageSize.
1238 // If there are no more results, nextPageToken is empty and err is nil.
1239 InternalFetch func(pageSize int, pageToken string) (results []*livestreampb.Clip, nextPageToken string, err error)
1240 }
1241
1242 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1243 func (it *ClipIterator) PageInfo() *iterator.PageInfo {
1244 return it.pageInfo
1245 }
1246
1247 // Next returns the next result. Its second return value is iterator.Done if there are no more
1248 // results. Once Next returns Done, all subsequent calls will return Done.
1249 func (it *ClipIterator) Next() (*livestreampb.Clip, error) {
1250 var item *livestreampb.Clip
1251 if err := it.nextFunc(); err != nil {
1252 return item, err
1253 }
1254 item = it.items[0]
1255 it.items = it.items[1:]
1256 return item, nil
1257 }
1258
1259 func (it *ClipIterator) bufLen() int {
1260 return len(it.items)
1261 }
1262
1263 func (it *ClipIterator) takeBuf() interface{} {
1264 b := it.items
1265 it.items = nil
1266 return b
1267 }
1268
1269 // DvrSessionIterator manages a stream of *livestreampb.DvrSession.
1270 type DvrSessionIterator struct {
1271 items []*livestreampb.DvrSession
1272 pageInfo *iterator.PageInfo
1273 nextFunc func() error
1274
1275 // Response is the raw response for the current page.
1276 // It must be cast to the RPC response type.
1277 // Calling Next() or InternalFetch() updates this value.
1278 Response interface{}
1279
1280 // InternalFetch is for use by the Google Cloud Libraries only.
1281 // It is not part of the stable interface of this package.
1282 //
1283 // InternalFetch returns results from a single call to the underlying RPC.
1284 // The number of results is no greater than pageSize.
1285 // If there are no more results, nextPageToken is empty and err is nil.
1286 InternalFetch func(pageSize int, pageToken string) (results []*livestreampb.DvrSession, nextPageToken string, err error)
1287 }
1288
1289 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1290 func (it *DvrSessionIterator) PageInfo() *iterator.PageInfo {
1291 return it.pageInfo
1292 }
1293
1294 // Next returns the next result. Its second return value is iterator.Done if there are no more
1295 // results. Once Next returns Done, all subsequent calls will return Done.
1296 func (it *DvrSessionIterator) Next() (*livestreampb.DvrSession, error) {
1297 var item *livestreampb.DvrSession
1298 if err := it.nextFunc(); err != nil {
1299 return item, err
1300 }
1301 item = it.items[0]
1302 it.items = it.items[1:]
1303 return item, nil
1304 }
1305
1306 func (it *DvrSessionIterator) bufLen() int {
1307 return len(it.items)
1308 }
1309
1310 func (it *DvrSessionIterator) takeBuf() interface{} {
1311 b := it.items
1312 it.items = nil
1313 return b
1314 }
1315
1316 // EventIterator manages a stream of *livestreampb.Event.
1317 type EventIterator struct {
1318 items []*livestreampb.Event
1319 pageInfo *iterator.PageInfo
1320 nextFunc func() error
1321
1322 // Response is the raw response for the current page.
1323 // It must be cast to the RPC response type.
1324 // Calling Next() or InternalFetch() updates this value.
1325 Response interface{}
1326
1327 // InternalFetch is for use by the Google Cloud Libraries only.
1328 // It is not part of the stable interface of this package.
1329 //
1330 // InternalFetch returns results from a single call to the underlying RPC.
1331 // The number of results is no greater than pageSize.
1332 // If there are no more results, nextPageToken is empty and err is nil.
1333 InternalFetch func(pageSize int, pageToken string) (results []*livestreampb.Event, nextPageToken string, err error)
1334 }
1335
1336 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1337 func (it *EventIterator) PageInfo() *iterator.PageInfo {
1338 return it.pageInfo
1339 }
1340
1341 // Next returns the next result. Its second return value is iterator.Done if there are no more
1342 // results. Once Next returns Done, all subsequent calls will return Done.
1343 func (it *EventIterator) Next() (*livestreampb.Event, error) {
1344 var item *livestreampb.Event
1345 if err := it.nextFunc(); err != nil {
1346 return item, err
1347 }
1348 item = it.items[0]
1349 it.items = it.items[1:]
1350 return item, nil
1351 }
1352
1353 func (it *EventIterator) bufLen() int {
1354 return len(it.items)
1355 }
1356
1357 func (it *EventIterator) takeBuf() interface{} {
1358 b := it.items
1359 it.items = nil
1360 return b
1361 }
1362
1363 // InputIterator manages a stream of *livestreampb.Input.
1364 type InputIterator struct {
1365 items []*livestreampb.Input
1366 pageInfo *iterator.PageInfo
1367 nextFunc func() error
1368
1369 // Response is the raw response for the current page.
1370 // It must be cast to the RPC response type.
1371 // Calling Next() or InternalFetch() updates this value.
1372 Response interface{}
1373
1374 // InternalFetch is for use by the Google Cloud Libraries only.
1375 // It is not part of the stable interface of this package.
1376 //
1377 // InternalFetch returns results from a single call to the underlying RPC.
1378 // The number of results is no greater than pageSize.
1379 // If there are no more results, nextPageToken is empty and err is nil.
1380 InternalFetch func(pageSize int, pageToken string) (results []*livestreampb.Input, nextPageToken string, err error)
1381 }
1382
1383 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1384 func (it *InputIterator) PageInfo() *iterator.PageInfo {
1385 return it.pageInfo
1386 }
1387
1388 // Next returns the next result. Its second return value is iterator.Done if there are no more
1389 // results. Once Next returns Done, all subsequent calls will return Done.
1390 func (it *InputIterator) Next() (*livestreampb.Input, error) {
1391 var item *livestreampb.Input
1392 if err := it.nextFunc(); err != nil {
1393 return item, err
1394 }
1395 item = it.items[0]
1396 it.items = it.items[1:]
1397 return item, nil
1398 }
1399
1400 func (it *InputIterator) bufLen() int {
1401 return len(it.items)
1402 }
1403
1404 func (it *InputIterator) takeBuf() interface{} {
1405 b := it.items
1406 it.items = nil
1407 return b
1408 }
1409
1410 // LocationIterator manages a stream of *locationpb.Location.
1411 type LocationIterator struct {
1412 items []*locationpb.Location
1413 pageInfo *iterator.PageInfo
1414 nextFunc func() error
1415
1416 // Response is the raw response for the current page.
1417 // It must be cast to the RPC response type.
1418 // Calling Next() or InternalFetch() updates this value.
1419 Response interface{}
1420
1421 // InternalFetch is for use by the Google Cloud Libraries only.
1422 // It is not part of the stable interface of this package.
1423 //
1424 // InternalFetch returns results from a single call to the underlying RPC.
1425 // The number of results is no greater than pageSize.
1426 // If there are no more results, nextPageToken is empty and err is nil.
1427 InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
1428 }
1429
1430 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1431 func (it *LocationIterator) PageInfo() *iterator.PageInfo {
1432 return it.pageInfo
1433 }
1434
1435 // Next returns the next result. Its second return value is iterator.Done if there are no more
1436 // results. Once Next returns Done, all subsequent calls will return Done.
1437 func (it *LocationIterator) Next() (*locationpb.Location, error) {
1438 var item *locationpb.Location
1439 if err := it.nextFunc(); err != nil {
1440 return item, err
1441 }
1442 item = it.items[0]
1443 it.items = it.items[1:]
1444 return item, nil
1445 }
1446
1447 func (it *LocationIterator) bufLen() int {
1448 return len(it.items)
1449 }
1450
1451 func (it *LocationIterator) takeBuf() interface{} {
1452 b := it.items
1453 it.items = nil
1454 return b
1455 }
1456
1457 // OperationIterator manages a stream of *longrunningpb.Operation.
1458 type OperationIterator struct {
1459 items []*longrunningpb.Operation
1460 pageInfo *iterator.PageInfo
1461 nextFunc func() error
1462
1463 // Response is the raw response for the current page.
1464 // It must be cast to the RPC response type.
1465 // Calling Next() or InternalFetch() updates this value.
1466 Response interface{}
1467
1468 // InternalFetch is for use by the Google Cloud Libraries only.
1469 // It is not part of the stable interface of this package.
1470 //
1471 // InternalFetch returns results from a single call to the underlying RPC.
1472 // The number of results is no greater than pageSize.
1473 // If there are no more results, nextPageToken is empty and err is nil.
1474 InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error)
1475 }
1476
1477 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1478 func (it *OperationIterator) PageInfo() *iterator.PageInfo {
1479 return it.pageInfo
1480 }
1481
1482 // Next returns the next result. Its second return value is iterator.Done if there are no more
1483 // results. Once Next returns Done, all subsequent calls will return Done.
1484 func (it *OperationIterator) Next() (*longrunningpb.Operation, error) {
1485 var item *longrunningpb.Operation
1486 if err := it.nextFunc(); err != nil {
1487 return item, err
1488 }
1489 item = it.items[0]
1490 it.items = it.items[1:]
1491 return item, nil
1492 }
1493
1494 func (it *OperationIterator) bufLen() int {
1495 return len(it.items)
1496 }
1497
1498 func (it *OperationIterator) takeBuf() interface{} {
1499 b := it.items
1500 it.items = nil
1501 return b
1502 }