google-cloud-video-live_stream-v1 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1697 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/video/livestream/v1/service_pb"
21
+ require "google/cloud/video/live_stream/v1/livestream_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Video
26
+ module LiveStream
27
+ module V1
28
+ module LivestreamService
29
+ module Rest
30
+ ##
31
+ # REST client for the LivestreamService service.
32
+ #
33
+ # Using Live Stream API, you can generate live streams in the various
34
+ # renditions and streaming formats. The streaming format include HTTP Live
35
+ # Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send
36
+ # a source stream in the various ways, including Real-Time Messaging
37
+ # Protocol (RTMP) and Secure Reliable Transport (SRT).
38
+ #
39
+ class Client
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :livestream_service_stub
44
+
45
+ ##
46
+ # Configure the LivestreamService Client class.
47
+ #
48
+ # See {::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all LivestreamService clients
54
+ # ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Video", "LiveStream", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.rpcs.create_channel.timeout = 60.0
75
+
76
+ default_config.rpcs.list_channels.timeout = 60.0
77
+ default_config.rpcs.list_channels.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config.rpcs.get_channel.timeout = 60.0
82
+ default_config.rpcs.get_channel.retry_policy = {
83
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
84
+ }
85
+
86
+ default_config.rpcs.delete_channel.timeout = 60.0
87
+
88
+ default_config.rpcs.update_channel.timeout = 60.0
89
+
90
+ default_config.rpcs.start_channel.timeout = 60.0
91
+
92
+ default_config.rpcs.stop_channel.timeout = 60.0
93
+
94
+ default_config.rpcs.create_input.timeout = 60.0
95
+
96
+ default_config.rpcs.list_inputs.timeout = 60.0
97
+ default_config.rpcs.list_inputs.retry_policy = {
98
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
99
+ }
100
+
101
+ default_config.rpcs.get_input.timeout = 60.0
102
+ default_config.rpcs.get_input.retry_policy = {
103
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
104
+ }
105
+
106
+ default_config.rpcs.delete_input.timeout = 60.0
107
+
108
+ default_config.rpcs.update_input.timeout = 60.0
109
+
110
+ default_config.rpcs.create_event.timeout = 60.0
111
+
112
+ default_config.rpcs.list_events.timeout = 60.0
113
+ default_config.rpcs.list_events.retry_policy = {
114
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
115
+ }
116
+
117
+ default_config.rpcs.get_event.timeout = 60.0
118
+ default_config.rpcs.get_event.retry_policy = {
119
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
120
+ }
121
+
122
+ default_config.rpcs.delete_event.timeout = 60.0
123
+
124
+ default_config
125
+ end
126
+ yield @configure if block_given?
127
+ @configure
128
+ end
129
+
130
+ ##
131
+ # Configure the LivestreamService Client instance.
132
+ #
133
+ # The configuration is set to the derived mode, meaning that values can be changed,
134
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
135
+ # should be made on {Client.configure}.
136
+ #
137
+ # See {::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client::Configuration}
138
+ # for a description of the configuration fields.
139
+ #
140
+ # @yield [config] Configure the Client client.
141
+ # @yieldparam config [Client::Configuration]
142
+ #
143
+ # @return [Client::Configuration]
144
+ #
145
+ def configure
146
+ yield @config if block_given?
147
+ @config
148
+ end
149
+
150
+ ##
151
+ # Create a new LivestreamService REST client object.
152
+ #
153
+ # @example
154
+ #
155
+ # # Create a client using the default configuration
156
+ # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new
157
+ #
158
+ # # Create a client using a custom configuration
159
+ # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config|
160
+ # config.timeout = 10.0
161
+ # end
162
+ #
163
+ # @yield [config] Configure the LivestreamService client.
164
+ # @yieldparam config [Client::Configuration]
165
+ #
166
+ def initialize
167
+ # Create the configuration object
168
+ @config = Configuration.new Client.configure
169
+
170
+ # Yield the configuration if needed
171
+ yield @config if block_given?
172
+
173
+ # Create credentials
174
+ credentials = @config.credentials
175
+ # Use self-signed JWT if the endpoint is unchanged from default,
176
+ # but only if the default endpoint does not have a region prefix.
177
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
178
+ !@config.endpoint.split(".").first.include?("-")
179
+ credentials ||= Credentials.default scope: @config.scope,
180
+ enable_self_signed_jwt: enable_self_signed_jwt
181
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
182
+ credentials = Credentials.new credentials, scope: @config.scope
183
+ end
184
+
185
+ @quota_project_id = @config.quota_project
186
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
187
+
188
+ @operations_client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Operations.new do |config|
189
+ config.credentials = credentials
190
+ config.quota_project = @quota_project_id
191
+ config.endpoint = @config.endpoint
192
+ end
193
+
194
+ @livestream_service_stub = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
195
+ end
196
+
197
+ ##
198
+ # Get the associated client for long-running operations.
199
+ #
200
+ # @return [::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Operations]
201
+ #
202
+ attr_reader :operations_client
203
+
204
+ # Service calls
205
+
206
+ ##
207
+ # Creates a channel with the provided unique ID in the specified
208
+ # region.
209
+ #
210
+ # @overload create_channel(request, options = nil)
211
+ # Pass arguments to `create_channel` via a request object, either of type
212
+ # {::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest} or an equivalent Hash.
213
+ #
214
+ # @param request [::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest, ::Hash]
215
+ # A request object representing the call parameters. Required. To specify no
216
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
217
+ # @param options [::Gapic::CallOptions, ::Hash]
218
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
219
+ #
220
+ # @overload create_channel(parent: nil, channel: nil, channel_id: nil, request_id: nil)
221
+ # Pass arguments to `create_channel` via keyword arguments. Note that at
222
+ # least one keyword argument is required. To specify no parameters, or to keep all
223
+ # the default parameter values, pass an empty Hash as a request object (see above).
224
+ #
225
+ # @param parent [::String]
226
+ # Required. The parent location for the resource, in the form of:
227
+ # `projects/{project}/locations/{location}`.
228
+ # @param channel [::Google::Cloud::Video::LiveStream::V1::Channel, ::Hash]
229
+ # Required. The channel resource to be created.
230
+ # @param channel_id [::String]
231
+ # Required. The ID of the channel resource to be created.
232
+ # This value must be 1-63 characters, begin and end with `[a-z0-9]`,
233
+ # could contain dashes (-) in between.
234
+ # @param request_id [::String]
235
+ # A request ID to identify requests. Specify a unique request ID
236
+ # so that if you must retry your request, the server will know to ignore
237
+ # the request if it has already been completed. The server will guarantee
238
+ # that for at least 60 minutes since the first request.
239
+ #
240
+ # For example, consider a situation where you make an initial request and the
241
+ # request times out. If you make the request again with the same request ID,
242
+ # the server can check if original operation with the same request ID was
243
+ # received, and if so, will ignore the second request. This prevents clients
244
+ # from accidentally creating duplicate commitments.
245
+ #
246
+ # The request ID must be a valid UUID with the exception that zero UUID is
247
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
248
+ # @yield [result, operation] Access the result along with the TransportOperation object
249
+ # @yieldparam result [::Gapic::Operation]
250
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
251
+ #
252
+ # @return [::Gapic::Operation]
253
+ #
254
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
255
+ def create_channel request, options = nil
256
+ raise ::ArgumentError, "request must be provided" if request.nil?
257
+
258
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest
259
+
260
+ # Converts hash and nil to an options object
261
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
262
+
263
+ # Customize the options with defaults
264
+ call_metadata = @config.rpcs.create_channel.metadata.to_h
265
+
266
+ # Set x-goog-api-client and x-goog-user-project headers
267
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
268
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
269
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
270
+ transports_version_send: [:rest]
271
+
272
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
273
+
274
+ options.apply_defaults timeout: @config.rpcs.create_channel.timeout,
275
+ metadata: call_metadata,
276
+ retry_policy: @config.rpcs.create_channel.retry_policy
277
+
278
+ options.apply_defaults timeout: @config.timeout,
279
+ metadata: @config.metadata,
280
+ retry_policy: @config.retry_policy
281
+
282
+ @livestream_service_stub.create_channel request, options do |result, operation|
283
+ result = ::Gapic::Operation.new result, @operations_client, options: options
284
+ yield result, operation if block_given?
285
+ return result
286
+ end
287
+ rescue ::Gapic::Rest::Error => e
288
+ raise ::Google::Cloud::Error.from_error(e)
289
+ end
290
+
291
+ ##
292
+ # Returns a list of all channels in the specified region.
293
+ #
294
+ # @overload list_channels(request, options = nil)
295
+ # Pass arguments to `list_channels` via a request object, either of type
296
+ # {::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest} or an equivalent Hash.
297
+ #
298
+ # @param request [::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest, ::Hash]
299
+ # A request object representing the call parameters. Required. To specify no
300
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
301
+ # @param options [::Gapic::CallOptions, ::Hash]
302
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
303
+ #
304
+ # @overload list_channels(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
305
+ # Pass arguments to `list_channels` via keyword arguments. Note that at
306
+ # least one keyword argument is required. To specify no parameters, or to keep all
307
+ # the default parameter values, pass an empty Hash as a request object (see above).
308
+ #
309
+ # @param parent [::String]
310
+ # Required. The parent location for the resource, in the form of:
311
+ # `projects/{project}/locations/{location}`.
312
+ # @param page_size [::Integer]
313
+ # The maximum number of items to return. If unspecified, server
314
+ # will pick an appropriate default. Server may return fewer items than
315
+ # requested. A caller should only rely on response's
316
+ # {::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse#next_page_token next_page_token} to
317
+ # determine if there are more items left to be queried.
318
+ # @param page_token [::String]
319
+ # The next_page_token value returned from a previous List request, if any.
320
+ # @param filter [::String]
321
+ # The filter to apply to list results.
322
+ # @param order_by [::String]
323
+ # Specifies the ordering of results following syntax at
324
+ # https://cloud.google.com/apis/design/design_patterns#sorting_order.
325
+ # @yield [result, operation] Access the result along with the TransportOperation object
326
+ # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse]
327
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
328
+ #
329
+ # @return [::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse]
330
+ #
331
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
332
+ def list_channels request, options = nil
333
+ raise ::ArgumentError, "request must be provided" if request.nil?
334
+
335
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest
336
+
337
+ # Converts hash and nil to an options object
338
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
339
+
340
+ # Customize the options with defaults
341
+ call_metadata = @config.rpcs.list_channels.metadata.to_h
342
+
343
+ # Set x-goog-api-client and x-goog-user-project headers
344
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
345
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
346
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
347
+ transports_version_send: [:rest]
348
+
349
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
350
+
351
+ options.apply_defaults timeout: @config.rpcs.list_channels.timeout,
352
+ metadata: call_metadata,
353
+ retry_policy: @config.rpcs.list_channels.retry_policy
354
+
355
+ options.apply_defaults timeout: @config.timeout,
356
+ metadata: @config.metadata,
357
+ retry_policy: @config.retry_policy
358
+
359
+ @livestream_service_stub.list_channels request, options do |result, operation|
360
+ yield result, operation if block_given?
361
+ return result
362
+ end
363
+ rescue ::Gapic::Rest::Error => e
364
+ raise ::Google::Cloud::Error.from_error(e)
365
+ end
366
+
367
+ ##
368
+ # Returns the specified channel.
369
+ #
370
+ # @overload get_channel(request, options = nil)
371
+ # Pass arguments to `get_channel` via a request object, either of type
372
+ # {::Google::Cloud::Video::LiveStream::V1::GetChannelRequest} or an equivalent Hash.
373
+ #
374
+ # @param request [::Google::Cloud::Video::LiveStream::V1::GetChannelRequest, ::Hash]
375
+ # A request object representing the call parameters. Required. To specify no
376
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
377
+ # @param options [::Gapic::CallOptions, ::Hash]
378
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
379
+ #
380
+ # @overload get_channel(name: nil)
381
+ # Pass arguments to `get_channel` via keyword arguments. Note that at
382
+ # least one keyword argument is required. To specify no parameters, or to keep all
383
+ # the default parameter values, pass an empty Hash as a request object (see above).
384
+ #
385
+ # @param name [::String]
386
+ # Required. The name of the channel resource, in the form of:
387
+ # `projects/{project}/locations/{location}/channels/{channelId}`.
388
+ # @yield [result, operation] Access the result along with the TransportOperation object
389
+ # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Channel]
390
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
391
+ #
392
+ # @return [::Google::Cloud::Video::LiveStream::V1::Channel]
393
+ #
394
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
395
+ def get_channel request, options = nil
396
+ raise ::ArgumentError, "request must be provided" if request.nil?
397
+
398
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest
399
+
400
+ # Converts hash and nil to an options object
401
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
402
+
403
+ # Customize the options with defaults
404
+ call_metadata = @config.rpcs.get_channel.metadata.to_h
405
+
406
+ # Set x-goog-api-client and x-goog-user-project headers
407
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
408
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
409
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
410
+ transports_version_send: [:rest]
411
+
412
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
413
+
414
+ options.apply_defaults timeout: @config.rpcs.get_channel.timeout,
415
+ metadata: call_metadata,
416
+ retry_policy: @config.rpcs.get_channel.retry_policy
417
+
418
+ options.apply_defaults timeout: @config.timeout,
419
+ metadata: @config.metadata,
420
+ retry_policy: @config.retry_policy
421
+
422
+ @livestream_service_stub.get_channel request, options do |result, operation|
423
+ yield result, operation if block_given?
424
+ return result
425
+ end
426
+ rescue ::Gapic::Rest::Error => e
427
+ raise ::Google::Cloud::Error.from_error(e)
428
+ end
429
+
430
+ ##
431
+ # Deletes the specified channel.
432
+ #
433
+ # @overload delete_channel(request, options = nil)
434
+ # Pass arguments to `delete_channel` via a request object, either of type
435
+ # {::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest} or an equivalent Hash.
436
+ #
437
+ # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest, ::Hash]
438
+ # A request object representing the call parameters. Required. To specify no
439
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
440
+ # @param options [::Gapic::CallOptions, ::Hash]
441
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
442
+ #
443
+ # @overload delete_channel(name: nil, request_id: nil, force: nil)
444
+ # Pass arguments to `delete_channel` via keyword arguments. Note that at
445
+ # least one keyword argument is required. To specify no parameters, or to keep all
446
+ # the default parameter values, pass an empty Hash as a request object (see above).
447
+ #
448
+ # @param name [::String]
449
+ # Required. The name of the channel resource, in the form of:
450
+ # `projects/{project}/locations/{location}/channels/{channelId}`.
451
+ # @param request_id [::String]
452
+ # A request ID to identify requests. Specify a unique request ID
453
+ # so that if you must retry your request, the server will know to ignore
454
+ # the request if it has already been completed. The server will guarantee
455
+ # that for at least 60 minutes after the first request.
456
+ #
457
+ # For example, consider a situation where you make an initial request and the
458
+ # request times out. If you make the request again with the same request ID,
459
+ # the server can check if original operation with the same request ID was
460
+ # received, and if so, will ignore the second request. This prevents clients
461
+ # from accidentally creating duplicate commitments.
462
+ #
463
+ # The request ID must be a valid UUID with the exception that zero UUID is
464
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
465
+ # @param force [::Boolean]
466
+ # If the `force` field is set to the default value of `false`, you must
467
+ # delete all of a channel's events before you can delete the channel itself.
468
+ # If the field is set to `true`, requests to delete a channel also delete
469
+ # associated channel events.
470
+ # @yield [result, operation] Access the result along with the TransportOperation object
471
+ # @yieldparam result [::Gapic::Operation]
472
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
473
+ #
474
+ # @return [::Gapic::Operation]
475
+ #
476
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
477
+ def delete_channel request, options = nil
478
+ raise ::ArgumentError, "request must be provided" if request.nil?
479
+
480
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest
481
+
482
+ # Converts hash and nil to an options object
483
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
484
+
485
+ # Customize the options with defaults
486
+ call_metadata = @config.rpcs.delete_channel.metadata.to_h
487
+
488
+ # Set x-goog-api-client and x-goog-user-project headers
489
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
490
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
491
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
492
+ transports_version_send: [:rest]
493
+
494
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
495
+
496
+ options.apply_defaults timeout: @config.rpcs.delete_channel.timeout,
497
+ metadata: call_metadata,
498
+ retry_policy: @config.rpcs.delete_channel.retry_policy
499
+
500
+ options.apply_defaults timeout: @config.timeout,
501
+ metadata: @config.metadata,
502
+ retry_policy: @config.retry_policy
503
+
504
+ @livestream_service_stub.delete_channel request, options do |result, operation|
505
+ result = ::Gapic::Operation.new result, @operations_client, options: options
506
+ yield result, operation if block_given?
507
+ return result
508
+ end
509
+ rescue ::Gapic::Rest::Error => e
510
+ raise ::Google::Cloud::Error.from_error(e)
511
+ end
512
+
513
+ ##
514
+ # Updates the specified channel.
515
+ #
516
+ # @overload update_channel(request, options = nil)
517
+ # Pass arguments to `update_channel` via a request object, either of type
518
+ # {::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest} or an equivalent Hash.
519
+ #
520
+ # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest, ::Hash]
521
+ # A request object representing the call parameters. Required. To specify no
522
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
523
+ # @param options [::Gapic::CallOptions, ::Hash]
524
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
525
+ #
526
+ # @overload update_channel(update_mask: nil, channel: nil, request_id: nil)
527
+ # Pass arguments to `update_channel` via keyword arguments. Note that at
528
+ # least one keyword argument is required. To specify no parameters, or to keep all
529
+ # the default parameter values, pass an empty Hash as a request object (see above).
530
+ #
531
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
532
+ # Field mask is used to specify the fields to be overwritten in the Channel
533
+ # resource by the update. You can only update the following fields:
534
+ #
535
+ # * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment)
536
+ # * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output)
537
+ # * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#ElementaryStream)
538
+ # * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream)
539
+ # * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#Manifest)
540
+ # * [`spritesheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet)
541
+ #
542
+ # The fields specified in the update_mask are relative to the resource, not
543
+ # the full request. A field will be overwritten if it is in the mask.
544
+ # @param channel [::Google::Cloud::Video::LiveStream::V1::Channel, ::Hash]
545
+ # Required. The channel resource to be updated.
546
+ # @param request_id [::String]
547
+ # A request ID to identify requests. Specify a unique request ID
548
+ # so that if you must retry your request, the server will know to ignore
549
+ # the request if it has already been completed. The server will guarantee
550
+ # that for at least 60 minutes since the first request.
551
+ #
552
+ # For example, consider a situation where you make an initial request and the
553
+ # request times out. If you make the request again with the same request ID,
554
+ # the server can check if original operation with the same request ID was
555
+ # received, and if so, will ignore the second request. This prevents clients
556
+ # from accidentally creating duplicate commitments.
557
+ #
558
+ # The request ID must be a valid UUID with the exception that zero UUID is
559
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
560
+ # @yield [result, operation] Access the result along with the TransportOperation object
561
+ # @yieldparam result [::Gapic::Operation]
562
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
563
+ #
564
+ # @return [::Gapic::Operation]
565
+ #
566
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
567
+ def update_channel request, options = nil
568
+ raise ::ArgumentError, "request must be provided" if request.nil?
569
+
570
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest
571
+
572
+ # Converts hash and nil to an options object
573
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
574
+
575
+ # Customize the options with defaults
576
+ call_metadata = @config.rpcs.update_channel.metadata.to_h
577
+
578
+ # Set x-goog-api-client and x-goog-user-project headers
579
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
580
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
581
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
582
+ transports_version_send: [:rest]
583
+
584
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
585
+
586
+ options.apply_defaults timeout: @config.rpcs.update_channel.timeout,
587
+ metadata: call_metadata,
588
+ retry_policy: @config.rpcs.update_channel.retry_policy
589
+
590
+ options.apply_defaults timeout: @config.timeout,
591
+ metadata: @config.metadata,
592
+ retry_policy: @config.retry_policy
593
+
594
+ @livestream_service_stub.update_channel request, options do |result, operation|
595
+ result = ::Gapic::Operation.new result, @operations_client, options: options
596
+ yield result, operation if block_given?
597
+ return result
598
+ end
599
+ rescue ::Gapic::Rest::Error => e
600
+ raise ::Google::Cloud::Error.from_error(e)
601
+ end
602
+
603
+ ##
604
+ # Starts the specified channel. Part of the video pipeline will be created
605
+ # only when the StartChannel request is received by the server.
606
+ #
607
+ # @overload start_channel(request, options = nil)
608
+ # Pass arguments to `start_channel` via a request object, either of type
609
+ # {::Google::Cloud::Video::LiveStream::V1::StartChannelRequest} or an equivalent Hash.
610
+ #
611
+ # @param request [::Google::Cloud::Video::LiveStream::V1::StartChannelRequest, ::Hash]
612
+ # A request object representing the call parameters. Required. To specify no
613
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
614
+ # @param options [::Gapic::CallOptions, ::Hash]
615
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
616
+ #
617
+ # @overload start_channel(name: nil, request_id: nil)
618
+ # Pass arguments to `start_channel` via keyword arguments. Note that at
619
+ # least one keyword argument is required. To specify no parameters, or to keep all
620
+ # the default parameter values, pass an empty Hash as a request object (see above).
621
+ #
622
+ # @param name [::String]
623
+ # Required. The name of the channel resource, in the form of:
624
+ # `projects/{project}/locations/{location}/channels/{channelId}`.
625
+ # @param request_id [::String]
626
+ # A request ID to identify requests. Specify a unique request ID
627
+ # so that if you must retry your request, the server will know to ignore
628
+ # the request if it has already been completed. The server will guarantee
629
+ # that for at least 60 minutes since the first request.
630
+ #
631
+ # For example, consider a situation where you make an initial request and the
632
+ # request times out. If you make the request again with the same request ID,
633
+ # the server can check if original operation with the same request ID was
634
+ # received, and if so, will ignore the second request. This prevents clients
635
+ # from accidentally creating duplicate commitments.
636
+ #
637
+ # The request ID must be a valid UUID with the exception that zero UUID is
638
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
639
+ # @yield [result, operation] Access the result along with the TransportOperation object
640
+ # @yieldparam result [::Gapic::Operation]
641
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
642
+ #
643
+ # @return [::Gapic::Operation]
644
+ #
645
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
646
+ def start_channel request, options = nil
647
+ raise ::ArgumentError, "request must be provided" if request.nil?
648
+
649
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest
650
+
651
+ # Converts hash and nil to an options object
652
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
653
+
654
+ # Customize the options with defaults
655
+ call_metadata = @config.rpcs.start_channel.metadata.to_h
656
+
657
+ # Set x-goog-api-client and x-goog-user-project headers
658
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
659
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
660
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
661
+ transports_version_send: [:rest]
662
+
663
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
664
+
665
+ options.apply_defaults timeout: @config.rpcs.start_channel.timeout,
666
+ metadata: call_metadata,
667
+ retry_policy: @config.rpcs.start_channel.retry_policy
668
+
669
+ options.apply_defaults timeout: @config.timeout,
670
+ metadata: @config.metadata,
671
+ retry_policy: @config.retry_policy
672
+
673
+ @livestream_service_stub.start_channel request, options do |result, operation|
674
+ result = ::Gapic::Operation.new result, @operations_client, options: options
675
+ yield result, operation if block_given?
676
+ return result
677
+ end
678
+ rescue ::Gapic::Rest::Error => e
679
+ raise ::Google::Cloud::Error.from_error(e)
680
+ end
681
+
682
+ ##
683
+ # Stops the specified channel. Part of the video pipeline will be released
684
+ # when the StopChannel request is received by the server.
685
+ #
686
+ # @overload stop_channel(request, options = nil)
687
+ # Pass arguments to `stop_channel` via a request object, either of type
688
+ # {::Google::Cloud::Video::LiveStream::V1::StopChannelRequest} or an equivalent Hash.
689
+ #
690
+ # @param request [::Google::Cloud::Video::LiveStream::V1::StopChannelRequest, ::Hash]
691
+ # A request object representing the call parameters. Required. To specify no
692
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
693
+ # @param options [::Gapic::CallOptions, ::Hash]
694
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
695
+ #
696
+ # @overload stop_channel(name: nil, request_id: nil)
697
+ # Pass arguments to `stop_channel` via keyword arguments. Note that at
698
+ # least one keyword argument is required. To specify no parameters, or to keep all
699
+ # the default parameter values, pass an empty Hash as a request object (see above).
700
+ #
701
+ # @param name [::String]
702
+ # Required. The name of the channel resource, in the form of:
703
+ # `projects/{project}/locations/{location}/channels/{channelId}`.
704
+ # @param request_id [::String]
705
+ # A request ID to identify requests. Specify a unique request ID
706
+ # so that if you must retry your request, the server will know to ignore
707
+ # the request if it has already been completed. The server will guarantee
708
+ # that for at least 60 minutes since the first request.
709
+ #
710
+ # For example, consider a situation where you make an initial request and the
711
+ # request times out. If you make the request again with the same request ID,
712
+ # the server can check if original operation with the same request ID was
713
+ # received, and if so, will ignore the second request. This prevents clients
714
+ # from accidentally creating duplicate commitments.
715
+ #
716
+ # The request ID must be a valid UUID with the exception that zero UUID is
717
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
718
+ # @yield [result, operation] Access the result along with the TransportOperation object
719
+ # @yieldparam result [::Gapic::Operation]
720
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
721
+ #
722
+ # @return [::Gapic::Operation]
723
+ #
724
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
725
+ def stop_channel request, options = nil
726
+ raise ::ArgumentError, "request must be provided" if request.nil?
727
+
728
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest
729
+
730
+ # Converts hash and nil to an options object
731
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
732
+
733
+ # Customize the options with defaults
734
+ call_metadata = @config.rpcs.stop_channel.metadata.to_h
735
+
736
+ # Set x-goog-api-client and x-goog-user-project headers
737
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
738
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
739
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
740
+ transports_version_send: [:rest]
741
+
742
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
743
+
744
+ options.apply_defaults timeout: @config.rpcs.stop_channel.timeout,
745
+ metadata: call_metadata,
746
+ retry_policy: @config.rpcs.stop_channel.retry_policy
747
+
748
+ options.apply_defaults timeout: @config.timeout,
749
+ metadata: @config.metadata,
750
+ retry_policy: @config.retry_policy
751
+
752
+ @livestream_service_stub.stop_channel request, options do |result, operation|
753
+ result = ::Gapic::Operation.new result, @operations_client, options: options
754
+ yield result, operation if block_given?
755
+ return result
756
+ end
757
+ rescue ::Gapic::Rest::Error => e
758
+ raise ::Google::Cloud::Error.from_error(e)
759
+ end
760
+
761
+ ##
762
+ # Creates an input with the provided unique ID in the specified region.
763
+ #
764
+ # @overload create_input(request, options = nil)
765
+ # Pass arguments to `create_input` via a request object, either of type
766
+ # {::Google::Cloud::Video::LiveStream::V1::CreateInputRequest} or an equivalent Hash.
767
+ #
768
+ # @param request [::Google::Cloud::Video::LiveStream::V1::CreateInputRequest, ::Hash]
769
+ # A request object representing the call parameters. Required. To specify no
770
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
771
+ # @param options [::Gapic::CallOptions, ::Hash]
772
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
773
+ #
774
+ # @overload create_input(parent: nil, input: nil, input_id: nil, request_id: nil)
775
+ # Pass arguments to `create_input` via keyword arguments. Note that at
776
+ # least one keyword argument is required. To specify no parameters, or to keep all
777
+ # the default parameter values, pass an empty Hash as a request object (see above).
778
+ #
779
+ # @param parent [::String]
780
+ # Required. The parent location for the resource, in the form of:
781
+ # `projects/{project}/locations/{location}`.
782
+ # @param input [::Google::Cloud::Video::LiveStream::V1::Input, ::Hash]
783
+ # Required. The input resource to be created.
784
+ # @param input_id [::String]
785
+ # Required. The ID of the input resource to be created.
786
+ # This value must be 1-63 characters, begin and end with `[a-z0-9]`,
787
+ # could contain dashes (-) in between.
788
+ # @param request_id [::String]
789
+ # A request ID to identify requests. Specify a unique request ID
790
+ # so that if you must retry your request, the server will know to ignore
791
+ # the request if it has already been completed. The server will guarantee
792
+ # that for at least 60 minutes since the first request.
793
+ #
794
+ # For example, consider a situation where you make an initial request and the
795
+ # request times out. If you make the request again with the same request ID,
796
+ # the server can check if original operation with the same request ID was
797
+ # received, and if so, will ignore the second request. This prevents clients
798
+ # from accidentally creating duplicate commitments.
799
+ #
800
+ # The request ID must be a valid UUID with the exception that zero UUID is
801
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
802
+ # @yield [result, operation] Access the result along with the TransportOperation object
803
+ # @yieldparam result [::Gapic::Operation]
804
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
805
+ #
806
+ # @return [::Gapic::Operation]
807
+ #
808
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
809
+ def create_input request, options = nil
810
+ raise ::ArgumentError, "request must be provided" if request.nil?
811
+
812
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest
813
+
814
+ # Converts hash and nil to an options object
815
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
816
+
817
+ # Customize the options with defaults
818
+ call_metadata = @config.rpcs.create_input.metadata.to_h
819
+
820
+ # Set x-goog-api-client and x-goog-user-project headers
821
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
822
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
823
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
824
+ transports_version_send: [:rest]
825
+
826
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
827
+
828
+ options.apply_defaults timeout: @config.rpcs.create_input.timeout,
829
+ metadata: call_metadata,
830
+ retry_policy: @config.rpcs.create_input.retry_policy
831
+
832
+ options.apply_defaults timeout: @config.timeout,
833
+ metadata: @config.metadata,
834
+ retry_policy: @config.retry_policy
835
+
836
+ @livestream_service_stub.create_input request, options do |result, operation|
837
+ result = ::Gapic::Operation.new result, @operations_client, options: options
838
+ yield result, operation if block_given?
839
+ return result
840
+ end
841
+ rescue ::Gapic::Rest::Error => e
842
+ raise ::Google::Cloud::Error.from_error(e)
843
+ end
844
+
845
+ ##
846
+ # Returns a list of all inputs in the specified region.
847
+ #
848
+ # @overload list_inputs(request, options = nil)
849
+ # Pass arguments to `list_inputs` via a request object, either of type
850
+ # {::Google::Cloud::Video::LiveStream::V1::ListInputsRequest} or an equivalent Hash.
851
+ #
852
+ # @param request [::Google::Cloud::Video::LiveStream::V1::ListInputsRequest, ::Hash]
853
+ # A request object representing the call parameters. Required. To specify no
854
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
855
+ # @param options [::Gapic::CallOptions, ::Hash]
856
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
857
+ #
858
+ # @overload list_inputs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
859
+ # Pass arguments to `list_inputs` via keyword arguments. Note that at
860
+ # least one keyword argument is required. To specify no parameters, or to keep all
861
+ # the default parameter values, pass an empty Hash as a request object (see above).
862
+ #
863
+ # @param parent [::String]
864
+ # Required. The parent location for the resource, in the form of:
865
+ # `projects/{project}/locations/{location}`.
866
+ # @param page_size [::Integer]
867
+ # The maximum number of items to return. If unspecified, server
868
+ # will pick an appropriate default. Server may return fewer items than
869
+ # requested. A caller should only rely on response's
870
+ # {::Google::Cloud::Video::LiveStream::V1::ListInputsResponse#next_page_token next_page_token} to
871
+ # determine if there are more items left to be queried.
872
+ # @param page_token [::String]
873
+ # The next_page_token value returned from a previous List request, if any.
874
+ # @param filter [::String]
875
+ # The filter to apply to list results.
876
+ # @param order_by [::String]
877
+ # Specifies the ordering of results following syntax at [Sorting
878
+ # Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
879
+ # @yield [result, operation] Access the result along with the TransportOperation object
880
+ # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::ListInputsResponse]
881
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
882
+ #
883
+ # @return [::Google::Cloud::Video::LiveStream::V1::ListInputsResponse]
884
+ #
885
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
886
+ def list_inputs request, options = nil
887
+ raise ::ArgumentError, "request must be provided" if request.nil?
888
+
889
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest
890
+
891
+ # Converts hash and nil to an options object
892
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
893
+
894
+ # Customize the options with defaults
895
+ call_metadata = @config.rpcs.list_inputs.metadata.to_h
896
+
897
+ # Set x-goog-api-client and x-goog-user-project headers
898
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
899
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
900
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
901
+ transports_version_send: [:rest]
902
+
903
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
904
+
905
+ options.apply_defaults timeout: @config.rpcs.list_inputs.timeout,
906
+ metadata: call_metadata,
907
+ retry_policy: @config.rpcs.list_inputs.retry_policy
908
+
909
+ options.apply_defaults timeout: @config.timeout,
910
+ metadata: @config.metadata,
911
+ retry_policy: @config.retry_policy
912
+
913
+ @livestream_service_stub.list_inputs request, options do |result, operation|
914
+ yield result, operation if block_given?
915
+ return result
916
+ end
917
+ rescue ::Gapic::Rest::Error => e
918
+ raise ::Google::Cloud::Error.from_error(e)
919
+ end
920
+
921
+ ##
922
+ # Returns the specified input.
923
+ #
924
+ # @overload get_input(request, options = nil)
925
+ # Pass arguments to `get_input` via a request object, either of type
926
+ # {::Google::Cloud::Video::LiveStream::V1::GetInputRequest} or an equivalent Hash.
927
+ #
928
+ # @param request [::Google::Cloud::Video::LiveStream::V1::GetInputRequest, ::Hash]
929
+ # A request object representing the call parameters. Required. To specify no
930
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
931
+ # @param options [::Gapic::CallOptions, ::Hash]
932
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
933
+ #
934
+ # @overload get_input(name: nil)
935
+ # Pass arguments to `get_input` via keyword arguments. Note that at
936
+ # least one keyword argument is required. To specify no parameters, or to keep all
937
+ # the default parameter values, pass an empty Hash as a request object (see above).
938
+ #
939
+ # @param name [::String]
940
+ # Required. The name of the input resource, in the form of:
941
+ # `projects/{project}/locations/{location}/inputs/{inputId}`.
942
+ # @yield [result, operation] Access the result along with the TransportOperation object
943
+ # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Input]
944
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
945
+ #
946
+ # @return [::Google::Cloud::Video::LiveStream::V1::Input]
947
+ #
948
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
949
+ def get_input request, options = nil
950
+ raise ::ArgumentError, "request must be provided" if request.nil?
951
+
952
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetInputRequest
953
+
954
+ # Converts hash and nil to an options object
955
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
956
+
957
+ # Customize the options with defaults
958
+ call_metadata = @config.rpcs.get_input.metadata.to_h
959
+
960
+ # Set x-goog-api-client and x-goog-user-project headers
961
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
962
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
963
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
964
+ transports_version_send: [:rest]
965
+
966
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
967
+
968
+ options.apply_defaults timeout: @config.rpcs.get_input.timeout,
969
+ metadata: call_metadata,
970
+ retry_policy: @config.rpcs.get_input.retry_policy
971
+
972
+ options.apply_defaults timeout: @config.timeout,
973
+ metadata: @config.metadata,
974
+ retry_policy: @config.retry_policy
975
+
976
+ @livestream_service_stub.get_input request, options do |result, operation|
977
+ yield result, operation if block_given?
978
+ return result
979
+ end
980
+ rescue ::Gapic::Rest::Error => e
981
+ raise ::Google::Cloud::Error.from_error(e)
982
+ end
983
+
984
+ ##
985
+ # Deletes the specified input.
986
+ #
987
+ # @overload delete_input(request, options = nil)
988
+ # Pass arguments to `delete_input` via a request object, either of type
989
+ # {::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest} or an equivalent Hash.
990
+ #
991
+ # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest, ::Hash]
992
+ # A request object representing the call parameters. Required. To specify no
993
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
994
+ # @param options [::Gapic::CallOptions, ::Hash]
995
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
996
+ #
997
+ # @overload delete_input(name: nil, request_id: nil)
998
+ # Pass arguments to `delete_input` via keyword arguments. Note that at
999
+ # least one keyword argument is required. To specify no parameters, or to keep all
1000
+ # the default parameter values, pass an empty Hash as a request object (see above).
1001
+ #
1002
+ # @param name [::String]
1003
+ # Required. The name of the input resource, in the form of:
1004
+ # `projects/{project}/locations/{location}/inputs/{inputId}`.
1005
+ # @param request_id [::String]
1006
+ # A request ID to identify requests. Specify a unique request ID
1007
+ # so that if you must retry your request, the server will know to ignore
1008
+ # the request if it has already been completed. The server will guarantee
1009
+ # that for at least 60 minutes since the first request.
1010
+ #
1011
+ # For example, consider a situation where you make an initial request and the
1012
+ # request times out. If you make the request again with the same request ID,
1013
+ # the server can check if original operation with the same request ID was
1014
+ # received, and if so, will ignore the second request. This prevents clients
1015
+ # from accidentally creating duplicate commitments.
1016
+ #
1017
+ # The request ID must be a valid UUID with the exception that zero UUID is
1018
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
1019
+ # @yield [result, operation] Access the result along with the TransportOperation object
1020
+ # @yieldparam result [::Gapic::Operation]
1021
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1022
+ #
1023
+ # @return [::Gapic::Operation]
1024
+ #
1025
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1026
+ def delete_input request, options = nil
1027
+ raise ::ArgumentError, "request must be provided" if request.nil?
1028
+
1029
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest
1030
+
1031
+ # Converts hash and nil to an options object
1032
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1033
+
1034
+ # Customize the options with defaults
1035
+ call_metadata = @config.rpcs.delete_input.metadata.to_h
1036
+
1037
+ # Set x-goog-api-client and x-goog-user-project headers
1038
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1039
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1040
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1041
+ transports_version_send: [:rest]
1042
+
1043
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1044
+
1045
+ options.apply_defaults timeout: @config.rpcs.delete_input.timeout,
1046
+ metadata: call_metadata,
1047
+ retry_policy: @config.rpcs.delete_input.retry_policy
1048
+
1049
+ options.apply_defaults timeout: @config.timeout,
1050
+ metadata: @config.metadata,
1051
+ retry_policy: @config.retry_policy
1052
+
1053
+ @livestream_service_stub.delete_input request, options do |result, operation|
1054
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1055
+ yield result, operation if block_given?
1056
+ return result
1057
+ end
1058
+ rescue ::Gapic::Rest::Error => e
1059
+ raise ::Google::Cloud::Error.from_error(e)
1060
+ end
1061
+
1062
+ ##
1063
+ # Updates the specified input.
1064
+ #
1065
+ # @overload update_input(request, options = nil)
1066
+ # Pass arguments to `update_input` via a request object, either of type
1067
+ # {::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest} or an equivalent Hash.
1068
+ #
1069
+ # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest, ::Hash]
1070
+ # A request object representing the call parameters. Required. To specify no
1071
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1072
+ # @param options [::Gapic::CallOptions, ::Hash]
1073
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1074
+ #
1075
+ # @overload update_input(update_mask: nil, input: nil, request_id: nil)
1076
+ # Pass arguments to `update_input` via keyword arguments. Note that at
1077
+ # least one keyword argument is required. To specify no parameters, or to keep all
1078
+ # the default parameter values, pass an empty Hash as a request object (see above).
1079
+ #
1080
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1081
+ # Field mask is used to specify the fields to be overwritten in the Input
1082
+ # resource by the update. You can only update the following fields:
1083
+ #
1084
+ # * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig)
1085
+ # * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule)
1086
+ #
1087
+ # The fields specified in the update_mask are relative to the resource, not
1088
+ # the full request. A field will be overwritten if it is in the mask.
1089
+ # @param input [::Google::Cloud::Video::LiveStream::V1::Input, ::Hash]
1090
+ # Required. The input resource to be updated.
1091
+ # @param request_id [::String]
1092
+ # A request ID to identify requests. Specify a unique request ID
1093
+ # so that if you must retry your request, the server will know to ignore
1094
+ # the request if it has already been completed. The server will guarantee
1095
+ # that for at least 60 minutes since the first request.
1096
+ #
1097
+ # For example, consider a situation where you make an initial request and the
1098
+ # request times out. If you make the request again with the same request ID,
1099
+ # the server can check if original operation with the same request ID was
1100
+ # received, and if so, will ignore the second request. This prevents clients
1101
+ # from accidentally creating duplicate commitments.
1102
+ #
1103
+ # The request ID must be a valid UUID with the exception that zero UUID is
1104
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
1105
+ # @yield [result, operation] Access the result along with the TransportOperation object
1106
+ # @yieldparam result [::Gapic::Operation]
1107
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1108
+ #
1109
+ # @return [::Gapic::Operation]
1110
+ #
1111
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1112
+ def update_input request, options = nil
1113
+ raise ::ArgumentError, "request must be provided" if request.nil?
1114
+
1115
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest
1116
+
1117
+ # Converts hash and nil to an options object
1118
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1119
+
1120
+ # Customize the options with defaults
1121
+ call_metadata = @config.rpcs.update_input.metadata.to_h
1122
+
1123
+ # Set x-goog-api-client and x-goog-user-project headers
1124
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1125
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1126
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1127
+ transports_version_send: [:rest]
1128
+
1129
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1130
+
1131
+ options.apply_defaults timeout: @config.rpcs.update_input.timeout,
1132
+ metadata: call_metadata,
1133
+ retry_policy: @config.rpcs.update_input.retry_policy
1134
+
1135
+ options.apply_defaults timeout: @config.timeout,
1136
+ metadata: @config.metadata,
1137
+ retry_policy: @config.retry_policy
1138
+
1139
+ @livestream_service_stub.update_input request, options do |result, operation|
1140
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1141
+ yield result, operation if block_given?
1142
+ return result
1143
+ end
1144
+ rescue ::Gapic::Rest::Error => e
1145
+ raise ::Google::Cloud::Error.from_error(e)
1146
+ end
1147
+
1148
+ ##
1149
+ # Creates an event with the provided unique ID in the specified channel.
1150
+ #
1151
+ # @overload create_event(request, options = nil)
1152
+ # Pass arguments to `create_event` via a request object, either of type
1153
+ # {::Google::Cloud::Video::LiveStream::V1::CreateEventRequest} or an equivalent Hash.
1154
+ #
1155
+ # @param request [::Google::Cloud::Video::LiveStream::V1::CreateEventRequest, ::Hash]
1156
+ # A request object representing the call parameters. Required. To specify no
1157
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1158
+ # @param options [::Gapic::CallOptions, ::Hash]
1159
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1160
+ #
1161
+ # @overload create_event(parent: nil, event: nil, event_id: nil, request_id: nil)
1162
+ # Pass arguments to `create_event` via keyword arguments. Note that at
1163
+ # least one keyword argument is required. To specify no parameters, or to keep all
1164
+ # the default parameter values, pass an empty Hash as a request object (see above).
1165
+ #
1166
+ # @param parent [::String]
1167
+ # Required. The parent channel for the resource, in the form of:
1168
+ # `projects/{project}/locations/{location}/channels/{channelId}`.
1169
+ # @param event [::Google::Cloud::Video::LiveStream::V1::Event, ::Hash]
1170
+ # Required. The event resource to be created.
1171
+ # @param event_id [::String]
1172
+ # Required. The ID of the event resource to be created.
1173
+ # This value must be 1-63 characters, begin and end with `[a-z0-9]`,
1174
+ # could contain dashes (-) in between.
1175
+ # @param request_id [::String]
1176
+ # A request ID to identify requests. Specify a unique request ID
1177
+ # so that if you must retry your request, the server will know to ignore
1178
+ # the request if it has already been completed. The server will guarantee
1179
+ # that for at least 60 minutes since the first request.
1180
+ #
1181
+ # For example, consider a situation where you make an initial request and the
1182
+ # request times out. If you make the request again with the same request ID,
1183
+ # the server can check if original operation with the same request ID was
1184
+ # received, and if so, will ignore the second request. This prevents clients
1185
+ # from accidentally creating duplicate commitments.
1186
+ #
1187
+ # The request ID must be a valid UUID with the exception that zero UUID is
1188
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
1189
+ # @yield [result, operation] Access the result along with the TransportOperation object
1190
+ # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Event]
1191
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1192
+ #
1193
+ # @return [::Google::Cloud::Video::LiveStream::V1::Event]
1194
+ #
1195
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1196
+ def create_event request, options = nil
1197
+ raise ::ArgumentError, "request must be provided" if request.nil?
1198
+
1199
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest
1200
+
1201
+ # Converts hash and nil to an options object
1202
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1203
+
1204
+ # Customize the options with defaults
1205
+ call_metadata = @config.rpcs.create_event.metadata.to_h
1206
+
1207
+ # Set x-goog-api-client and x-goog-user-project headers
1208
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1209
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1210
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1211
+ transports_version_send: [:rest]
1212
+
1213
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1214
+
1215
+ options.apply_defaults timeout: @config.rpcs.create_event.timeout,
1216
+ metadata: call_metadata,
1217
+ retry_policy: @config.rpcs.create_event.retry_policy
1218
+
1219
+ options.apply_defaults timeout: @config.timeout,
1220
+ metadata: @config.metadata,
1221
+ retry_policy: @config.retry_policy
1222
+
1223
+ @livestream_service_stub.create_event request, options do |result, operation|
1224
+ yield result, operation if block_given?
1225
+ return result
1226
+ end
1227
+ rescue ::Gapic::Rest::Error => e
1228
+ raise ::Google::Cloud::Error.from_error(e)
1229
+ end
1230
+
1231
+ ##
1232
+ # Returns a list of all events in the specified channel.
1233
+ #
1234
+ # @overload list_events(request, options = nil)
1235
+ # Pass arguments to `list_events` via a request object, either of type
1236
+ # {::Google::Cloud::Video::LiveStream::V1::ListEventsRequest} or an equivalent Hash.
1237
+ #
1238
+ # @param request [::Google::Cloud::Video::LiveStream::V1::ListEventsRequest, ::Hash]
1239
+ # A request object representing the call parameters. Required. To specify no
1240
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1241
+ # @param options [::Gapic::CallOptions, ::Hash]
1242
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1243
+ #
1244
+ # @overload list_events(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1245
+ # Pass arguments to `list_events` via keyword arguments. Note that at
1246
+ # least one keyword argument is required. To specify no parameters, or to keep all
1247
+ # the default parameter values, pass an empty Hash as a request object (see above).
1248
+ #
1249
+ # @param parent [::String]
1250
+ # Required. The parent channel for the resource, in the form of:
1251
+ # `projects/{project}/locations/{location}/channels/{channelId}`.
1252
+ # @param page_size [::Integer]
1253
+ # The maximum number of items to return. If unspecified, server
1254
+ # will pick an appropriate default. Server may return fewer items than
1255
+ # requested. A caller should only rely on response's
1256
+ # {::Google::Cloud::Video::LiveStream::V1::ListEventsResponse#next_page_token next_page_token} to
1257
+ # determine if there are more items left to be queried.
1258
+ # @param page_token [::String]
1259
+ # The next_page_token value returned from a previous List request, if any.
1260
+ # @param filter [::String]
1261
+ # The filter to apply to list results.
1262
+ # @param order_by [::String]
1263
+ # Specifies the ordering of results following syntax at
1264
+ # https://cloud.google.com/apis/design/design_patterns#sorting_order.
1265
+ # @yield [result, operation] Access the result along with the TransportOperation object
1266
+ # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::ListEventsResponse]
1267
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1268
+ #
1269
+ # @return [::Google::Cloud::Video::LiveStream::V1::ListEventsResponse]
1270
+ #
1271
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1272
+ def list_events request, options = nil
1273
+ raise ::ArgumentError, "request must be provided" if request.nil?
1274
+
1275
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest
1276
+
1277
+ # Converts hash and nil to an options object
1278
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1279
+
1280
+ # Customize the options with defaults
1281
+ call_metadata = @config.rpcs.list_events.metadata.to_h
1282
+
1283
+ # Set x-goog-api-client and x-goog-user-project headers
1284
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1285
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1286
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1287
+ transports_version_send: [:rest]
1288
+
1289
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1290
+
1291
+ options.apply_defaults timeout: @config.rpcs.list_events.timeout,
1292
+ metadata: call_metadata,
1293
+ retry_policy: @config.rpcs.list_events.retry_policy
1294
+
1295
+ options.apply_defaults timeout: @config.timeout,
1296
+ metadata: @config.metadata,
1297
+ retry_policy: @config.retry_policy
1298
+
1299
+ @livestream_service_stub.list_events request, options do |result, operation|
1300
+ yield result, operation if block_given?
1301
+ return result
1302
+ end
1303
+ rescue ::Gapic::Rest::Error => e
1304
+ raise ::Google::Cloud::Error.from_error(e)
1305
+ end
1306
+
1307
+ ##
1308
+ # Returns the specified event.
1309
+ #
1310
+ # @overload get_event(request, options = nil)
1311
+ # Pass arguments to `get_event` via a request object, either of type
1312
+ # {::Google::Cloud::Video::LiveStream::V1::GetEventRequest} or an equivalent Hash.
1313
+ #
1314
+ # @param request [::Google::Cloud::Video::LiveStream::V1::GetEventRequest, ::Hash]
1315
+ # A request object representing the call parameters. Required. To specify no
1316
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1317
+ # @param options [::Gapic::CallOptions, ::Hash]
1318
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1319
+ #
1320
+ # @overload get_event(name: nil)
1321
+ # Pass arguments to `get_event` via keyword arguments. Note that at
1322
+ # least one keyword argument is required. To specify no parameters, or to keep all
1323
+ # the default parameter values, pass an empty Hash as a request object (see above).
1324
+ #
1325
+ # @param name [::String]
1326
+ # Required. The name of the event resource, in the form of:
1327
+ # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`.
1328
+ # @yield [result, operation] Access the result along with the TransportOperation object
1329
+ # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Event]
1330
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1331
+ #
1332
+ # @return [::Google::Cloud::Video::LiveStream::V1::Event]
1333
+ #
1334
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1335
+ def get_event request, options = nil
1336
+ raise ::ArgumentError, "request must be provided" if request.nil?
1337
+
1338
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetEventRequest
1339
+
1340
+ # Converts hash and nil to an options object
1341
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1342
+
1343
+ # Customize the options with defaults
1344
+ call_metadata = @config.rpcs.get_event.metadata.to_h
1345
+
1346
+ # Set x-goog-api-client and x-goog-user-project headers
1347
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1348
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1349
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1350
+ transports_version_send: [:rest]
1351
+
1352
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1353
+
1354
+ options.apply_defaults timeout: @config.rpcs.get_event.timeout,
1355
+ metadata: call_metadata,
1356
+ retry_policy: @config.rpcs.get_event.retry_policy
1357
+
1358
+ options.apply_defaults timeout: @config.timeout,
1359
+ metadata: @config.metadata,
1360
+ retry_policy: @config.retry_policy
1361
+
1362
+ @livestream_service_stub.get_event request, options do |result, operation|
1363
+ yield result, operation if block_given?
1364
+ return result
1365
+ end
1366
+ rescue ::Gapic::Rest::Error => e
1367
+ raise ::Google::Cloud::Error.from_error(e)
1368
+ end
1369
+
1370
+ ##
1371
+ # Deletes the specified event.
1372
+ #
1373
+ # @overload delete_event(request, options = nil)
1374
+ # Pass arguments to `delete_event` via a request object, either of type
1375
+ # {::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest} or an equivalent Hash.
1376
+ #
1377
+ # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest, ::Hash]
1378
+ # A request object representing the call parameters. Required. To specify no
1379
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1380
+ # @param options [::Gapic::CallOptions, ::Hash]
1381
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1382
+ #
1383
+ # @overload delete_event(name: nil, request_id: nil)
1384
+ # Pass arguments to `delete_event` via keyword arguments. Note that at
1385
+ # least one keyword argument is required. To specify no parameters, or to keep all
1386
+ # the default parameter values, pass an empty Hash as a request object (see above).
1387
+ #
1388
+ # @param name [::String]
1389
+ # Required. The name of the event resource, in the form of:
1390
+ # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`.
1391
+ # @param request_id [::String]
1392
+ # A request ID to identify requests. Specify a unique request ID
1393
+ # so that if you must retry your request, the server will know to ignore
1394
+ # the request if it has already been completed. The server will guarantee
1395
+ # that for at least 60 minutes since the first request.
1396
+ #
1397
+ # For example, consider a situation where you make an initial request and the
1398
+ # request times out. If you make the request again with the same request ID,
1399
+ # the server can check if original operation with the same request ID was
1400
+ # received, and if so, will ignore the second request. This prevents clients
1401
+ # from accidentally creating duplicate commitments.
1402
+ #
1403
+ # The request ID must be a valid UUID with the exception that zero UUID is
1404
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
1405
+ # @yield [result, operation] Access the result along with the TransportOperation object
1406
+ # @yieldparam result [::Google::Protobuf::Empty]
1407
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1408
+ #
1409
+ # @return [::Google::Protobuf::Empty]
1410
+ #
1411
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1412
+ def delete_event request, options = nil
1413
+ raise ::ArgumentError, "request must be provided" if request.nil?
1414
+
1415
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest
1416
+
1417
+ # Converts hash and nil to an options object
1418
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1419
+
1420
+ # Customize the options with defaults
1421
+ call_metadata = @config.rpcs.delete_event.metadata.to_h
1422
+
1423
+ # Set x-goog-api-client and x-goog-user-project headers
1424
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1425
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1426
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1427
+ transports_version_send: [:rest]
1428
+
1429
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1430
+
1431
+ options.apply_defaults timeout: @config.rpcs.delete_event.timeout,
1432
+ metadata: call_metadata,
1433
+ retry_policy: @config.rpcs.delete_event.retry_policy
1434
+
1435
+ options.apply_defaults timeout: @config.timeout,
1436
+ metadata: @config.metadata,
1437
+ retry_policy: @config.retry_policy
1438
+
1439
+ @livestream_service_stub.delete_event request, options do |result, operation|
1440
+ yield result, operation if block_given?
1441
+ return result
1442
+ end
1443
+ rescue ::Gapic::Rest::Error => e
1444
+ raise ::Google::Cloud::Error.from_error(e)
1445
+ end
1446
+
1447
+ ##
1448
+ # Configuration class for the LivestreamService REST API.
1449
+ #
1450
+ # This class represents the configuration for LivestreamService REST,
1451
+ # providing control over timeouts, retry behavior, logging, transport
1452
+ # parameters, and other low-level controls. Certain parameters can also be
1453
+ # applied individually to specific RPCs. See
1454
+ # {::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client::Configuration::Rpcs}
1455
+ # for a list of RPCs that can be configured independently.
1456
+ #
1457
+ # Configuration can be applied globally to all clients, or to a single client
1458
+ # on construction.
1459
+ #
1460
+ # @example
1461
+ #
1462
+ # # Modify the global config, setting the timeout for
1463
+ # # create_channel to 20 seconds,
1464
+ # # and all remaining timeouts to 10 seconds.
1465
+ # ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.configure do |config|
1466
+ # config.timeout = 10.0
1467
+ # config.rpcs.create_channel.timeout = 20.0
1468
+ # end
1469
+ #
1470
+ # # Apply the above configuration only to a new client.
1471
+ # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config|
1472
+ # config.timeout = 10.0
1473
+ # config.rpcs.create_channel.timeout = 20.0
1474
+ # end
1475
+ #
1476
+ # @!attribute [rw] endpoint
1477
+ # The hostname or hostname:port of the service endpoint.
1478
+ # Defaults to `"livestream.googleapis.com"`.
1479
+ # @return [::String]
1480
+ # @!attribute [rw] credentials
1481
+ # Credentials to send with calls. You may provide any of the following types:
1482
+ # * (`String`) The path to a service account key file in JSON format
1483
+ # * (`Hash`) A service account key as a Hash
1484
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1485
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1486
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1487
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1488
+ # * (`nil`) indicating no credentials
1489
+ # @return [::Object]
1490
+ # @!attribute [rw] scope
1491
+ # The OAuth scopes
1492
+ # @return [::Array<::String>]
1493
+ # @!attribute [rw] lib_name
1494
+ # The library name as recorded in instrumentation and logging
1495
+ # @return [::String]
1496
+ # @!attribute [rw] lib_version
1497
+ # The library version as recorded in instrumentation and logging
1498
+ # @return [::String]
1499
+ # @!attribute [rw] timeout
1500
+ # The call timeout in seconds.
1501
+ # @return [::Numeric]
1502
+ # @!attribute [rw] metadata
1503
+ # Additional headers to be sent with the call.
1504
+ # @return [::Hash{::Symbol=>::String}]
1505
+ # @!attribute [rw] retry_policy
1506
+ # The retry policy. The value is a hash with the following keys:
1507
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1508
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1509
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1510
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1511
+ # trigger a retry.
1512
+ # @return [::Hash]
1513
+ # @!attribute [rw] quota_project
1514
+ # A separate project against which to charge quota.
1515
+ # @return [::String]
1516
+ #
1517
+ class Configuration
1518
+ extend ::Gapic::Config
1519
+
1520
+ config_attr :endpoint, "livestream.googleapis.com", ::String
1521
+ config_attr :credentials, nil do |value|
1522
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1523
+ allowed.any? { |klass| klass === value }
1524
+ end
1525
+ config_attr :scope, nil, ::String, ::Array, nil
1526
+ config_attr :lib_name, nil, ::String, nil
1527
+ config_attr :lib_version, nil, ::String, nil
1528
+ config_attr :timeout, nil, ::Numeric, nil
1529
+ config_attr :metadata, nil, ::Hash, nil
1530
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1531
+ config_attr :quota_project, nil, ::String, nil
1532
+
1533
+ # @private
1534
+ def initialize parent_config = nil
1535
+ @parent_config = parent_config unless parent_config.nil?
1536
+
1537
+ yield self if block_given?
1538
+ end
1539
+
1540
+ ##
1541
+ # Configurations for individual RPCs
1542
+ # @return [Rpcs]
1543
+ #
1544
+ def rpcs
1545
+ @rpcs ||= begin
1546
+ parent_rpcs = nil
1547
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1548
+ Rpcs.new parent_rpcs
1549
+ end
1550
+ end
1551
+
1552
+ ##
1553
+ # Configuration RPC class for the LivestreamService API.
1554
+ #
1555
+ # Includes fields providing the configuration for each RPC in this service.
1556
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1557
+ # the following configuration fields:
1558
+ #
1559
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1560
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1561
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1562
+ # include the following keys:
1563
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1564
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1565
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1566
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1567
+ # trigger a retry.
1568
+ #
1569
+ class Rpcs
1570
+ ##
1571
+ # RPC-specific configuration for `create_channel`
1572
+ # @return [::Gapic::Config::Method]
1573
+ #
1574
+ attr_reader :create_channel
1575
+ ##
1576
+ # RPC-specific configuration for `list_channels`
1577
+ # @return [::Gapic::Config::Method]
1578
+ #
1579
+ attr_reader :list_channels
1580
+ ##
1581
+ # RPC-specific configuration for `get_channel`
1582
+ # @return [::Gapic::Config::Method]
1583
+ #
1584
+ attr_reader :get_channel
1585
+ ##
1586
+ # RPC-specific configuration for `delete_channel`
1587
+ # @return [::Gapic::Config::Method]
1588
+ #
1589
+ attr_reader :delete_channel
1590
+ ##
1591
+ # RPC-specific configuration for `update_channel`
1592
+ # @return [::Gapic::Config::Method]
1593
+ #
1594
+ attr_reader :update_channel
1595
+ ##
1596
+ # RPC-specific configuration for `start_channel`
1597
+ # @return [::Gapic::Config::Method]
1598
+ #
1599
+ attr_reader :start_channel
1600
+ ##
1601
+ # RPC-specific configuration for `stop_channel`
1602
+ # @return [::Gapic::Config::Method]
1603
+ #
1604
+ attr_reader :stop_channel
1605
+ ##
1606
+ # RPC-specific configuration for `create_input`
1607
+ # @return [::Gapic::Config::Method]
1608
+ #
1609
+ attr_reader :create_input
1610
+ ##
1611
+ # RPC-specific configuration for `list_inputs`
1612
+ # @return [::Gapic::Config::Method]
1613
+ #
1614
+ attr_reader :list_inputs
1615
+ ##
1616
+ # RPC-specific configuration for `get_input`
1617
+ # @return [::Gapic::Config::Method]
1618
+ #
1619
+ attr_reader :get_input
1620
+ ##
1621
+ # RPC-specific configuration for `delete_input`
1622
+ # @return [::Gapic::Config::Method]
1623
+ #
1624
+ attr_reader :delete_input
1625
+ ##
1626
+ # RPC-specific configuration for `update_input`
1627
+ # @return [::Gapic::Config::Method]
1628
+ #
1629
+ attr_reader :update_input
1630
+ ##
1631
+ # RPC-specific configuration for `create_event`
1632
+ # @return [::Gapic::Config::Method]
1633
+ #
1634
+ attr_reader :create_event
1635
+ ##
1636
+ # RPC-specific configuration for `list_events`
1637
+ # @return [::Gapic::Config::Method]
1638
+ #
1639
+ attr_reader :list_events
1640
+ ##
1641
+ # RPC-specific configuration for `get_event`
1642
+ # @return [::Gapic::Config::Method]
1643
+ #
1644
+ attr_reader :get_event
1645
+ ##
1646
+ # RPC-specific configuration for `delete_event`
1647
+ # @return [::Gapic::Config::Method]
1648
+ #
1649
+ attr_reader :delete_event
1650
+
1651
+ # @private
1652
+ def initialize parent_rpcs = nil
1653
+ create_channel_config = parent_rpcs.create_channel if parent_rpcs.respond_to? :create_channel
1654
+ @create_channel = ::Gapic::Config::Method.new create_channel_config
1655
+ list_channels_config = parent_rpcs.list_channels if parent_rpcs.respond_to? :list_channels
1656
+ @list_channels = ::Gapic::Config::Method.new list_channels_config
1657
+ get_channel_config = parent_rpcs.get_channel if parent_rpcs.respond_to? :get_channel
1658
+ @get_channel = ::Gapic::Config::Method.new get_channel_config
1659
+ delete_channel_config = parent_rpcs.delete_channel if parent_rpcs.respond_to? :delete_channel
1660
+ @delete_channel = ::Gapic::Config::Method.new delete_channel_config
1661
+ update_channel_config = parent_rpcs.update_channel if parent_rpcs.respond_to? :update_channel
1662
+ @update_channel = ::Gapic::Config::Method.new update_channel_config
1663
+ start_channel_config = parent_rpcs.start_channel if parent_rpcs.respond_to? :start_channel
1664
+ @start_channel = ::Gapic::Config::Method.new start_channel_config
1665
+ stop_channel_config = parent_rpcs.stop_channel if parent_rpcs.respond_to? :stop_channel
1666
+ @stop_channel = ::Gapic::Config::Method.new stop_channel_config
1667
+ create_input_config = parent_rpcs.create_input if parent_rpcs.respond_to? :create_input
1668
+ @create_input = ::Gapic::Config::Method.new create_input_config
1669
+ list_inputs_config = parent_rpcs.list_inputs if parent_rpcs.respond_to? :list_inputs
1670
+ @list_inputs = ::Gapic::Config::Method.new list_inputs_config
1671
+ get_input_config = parent_rpcs.get_input if parent_rpcs.respond_to? :get_input
1672
+ @get_input = ::Gapic::Config::Method.new get_input_config
1673
+ delete_input_config = parent_rpcs.delete_input if parent_rpcs.respond_to? :delete_input
1674
+ @delete_input = ::Gapic::Config::Method.new delete_input_config
1675
+ update_input_config = parent_rpcs.update_input if parent_rpcs.respond_to? :update_input
1676
+ @update_input = ::Gapic::Config::Method.new update_input_config
1677
+ create_event_config = parent_rpcs.create_event if parent_rpcs.respond_to? :create_event
1678
+ @create_event = ::Gapic::Config::Method.new create_event_config
1679
+ list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events
1680
+ @list_events = ::Gapic::Config::Method.new list_events_config
1681
+ get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event
1682
+ @get_event = ::Gapic::Config::Method.new get_event_config
1683
+ delete_event_config = parent_rpcs.delete_event if parent_rpcs.respond_to? :delete_event
1684
+ @delete_event = ::Gapic::Config::Method.new delete_event_config
1685
+
1686
+ yield self if block_given?
1687
+ end
1688
+ end
1689
+ end
1690
+ end
1691
+ end
1692
+ end
1693
+ end
1694
+ end
1695
+ end
1696
+ end
1697
+ end