google-cloud-video-live_stream-v1 0.2.0 → 0.4.0

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