Class: Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb

Overview

REST client for the LivestreamService service.

Using Live Stream API, you can generate live streams in the various renditions and streaming formats. The streaming format include HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send a source stream in the various ways, including Real-Time Messaging Protocol (RTMP) and Secure Reliable Transport (SRT).

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#asset_path, #channel_path, #clip_path, #dvr_session_path, #event_path, #input_path, #location_path, #network_path, #pool_path, #secret_version_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new LivestreamService REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the LivestreamService client.

Yield Parameters:



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 239

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @livestream_service_stub = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @livestream_service_stub.logger(stub: true)&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end

  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @livestream_service_stub.endpoint
    config.universe_domain = @livestream_service_stub.universe_domain
    config.bindings_override = @config.bindings_override
    config.logger = @livestream_service_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#location_clientGoogle::Cloud::Location::Locations::Rest::Client (readonly)

Get the associated client for mix-in of the Locations.



309
310
311
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 309

def location_client
  @location_client
end

#operations_client::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Operations (readonly)

Get the associated client for long-running operations.



302
303
304
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 302

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the LivestreamService Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all LivestreamService clients
::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 70

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Video", "LiveStream", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.rpcs.create_channel.timeout = 60.0

    default_config.rpcs.list_channels.timeout = 60.0
    default_config.rpcs.list_channels.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_channel.timeout = 60.0
    default_config.rpcs.get_channel.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.delete_channel.timeout = 60.0

    default_config.rpcs.update_channel.timeout = 60.0

    default_config.rpcs.start_channel.timeout = 60.0

    default_config.rpcs.stop_channel.timeout = 60.0

    default_config.rpcs.start_distribution.timeout = 60.0

    default_config.rpcs.stop_distribution.timeout = 60.0

    default_config.rpcs.create_input.timeout = 60.0

    default_config.rpcs.list_inputs.timeout = 60.0
    default_config.rpcs.list_inputs.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_input.timeout = 60.0
    default_config.rpcs.get_input.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.delete_input.timeout = 60.0

    default_config.rpcs.update_input.timeout = 60.0

    default_config.rpcs.preview_input.timeout = 60.0

    default_config.rpcs.create_event.timeout = 60.0

    default_config.rpcs.list_events.timeout = 60.0
    default_config.rpcs.list_events.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_event.timeout = 60.0
    default_config.rpcs.get_event.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.delete_event.timeout = 60.0

    default_config.rpcs.list_clips.timeout = 60.0
    default_config.rpcs.list_clips.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_clip.timeout = 60.0
    default_config.rpcs.get_clip.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_clip.timeout = 60.0

    default_config.rpcs.delete_clip.timeout = 60.0

    default_config.rpcs.create_dvr_session.timeout = 60.0

    default_config.rpcs.list_dvr_sessions.timeout = 60.0
    default_config.rpcs.list_dvr_sessions.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_dvr_session.timeout = 60.0
    default_config.rpcs.get_dvr_session.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.delete_dvr_session.timeout = 60.0

    default_config.rpcs.update_dvr_session.timeout = 60.0

    default_config.rpcs.create_asset.timeout = 60.0

    default_config.rpcs.delete_asset.timeout = 60.0

    default_config.rpcs.get_asset.timeout = 60.0
    default_config.rpcs.get_asset.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_assets.timeout = 60.0
    default_config.rpcs.list_assets.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_pool.timeout = 60.0
    default_config.rpcs.get_pool.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.update_pool.timeout = 60.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

Configure the LivestreamService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:



209
210
211
212
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 209

def configure
  yield @config if block_given?
  @config
end

#create_asset(request, options = nil) ⇒ ::Gapic::Operation #create_asset(parent: nil, asset: nil, asset_id: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a Asset with the provided unique ID in the specified region.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new

# Call the create_asset method.
result = client.create_asset request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_asset(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_asset via a request object, either of type CreateAssetRequest or an equivalent Hash.

  • #create_asset(parent: nil, asset: nil, asset_id: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_asset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 3171

def create_asset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_asset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_asset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_asset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.create_asset request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_channel(request, options = nil) ⇒ ::Gapic::Operation #create_channel(parent: nil, channel: nil, channel_id: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a channel with the provided unique ID in the specified region.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new

# Call the create_channel method.
result = client.create_channel request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_channel(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_channel via a request object, either of type CreateChannelRequest or an equivalent Hash.

  • #create_channel(parent: nil, channel: nil, channel_id: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_channel via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 397

def create_channel request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_channel..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_channel.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_channel.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.create_channel request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_clip(request, options = nil) ⇒ ::Gapic::Operation #create_clip(parent: nil, clip_id: nil, clip: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a clip with the provided clip ID in the specified channel.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new

# Call the create_clip method.
result = client.create_clip request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_clip(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_clip via a request object, either of type CreateClipRequest or an equivalent Hash.

  • #create_clip(parent: nil, clip_id: nil, clip: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_clip via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 2461

def create_clip request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_clip..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_clip.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_clip.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.create_clip request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_dvr_session(request, options = nil) ⇒ ::Gapic::Operation #create_dvr_session(parent: nil, dvr_session_id: nil, dvr_session: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a DVR session with the provided unique ID in the specified channel.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new

# Call the create_dvr_session method.
result = client.create_dvr_session request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_dvr_session(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_dvr_session via a request object, either of type CreateDvrSessionRequest or an equivalent Hash.

  • #create_dvr_session(parent: nil, dvr_session_id: nil, dvr_session: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_dvr_session via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 2675

def create_dvr_session request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_dvr_session..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_dvr_session.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_dvr_session.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.create_dvr_session request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_event(request, options = nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Event #create_event(parent: nil, event: nil, event_id: nil, request_id: nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Event

Creates an event with the provided unique ID in the specified channel.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new

# Call the create_event method.
result = client.create_event request

# The returned object is of type Google::Cloud::Video::LiveStream::V1::Event.
p result

Overloads:

  • #create_event(request, options = nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Event

    Pass arguments to create_event via a request object, either of type CreateEventRequest or an equivalent Hash.

  • #create_event(parent: nil, event: nil, event_id: nil, request_id: nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Event

    Pass arguments to create_event via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 1910

def create_event request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_event..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_event.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_event.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.create_event request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_input(request, options = nil) ⇒ ::Gapic::Operation #create_input(parent: nil, input: nil, input_id: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates an input with the provided unique ID in the specified region.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new

# Call the create_input method.
result = client.create_input request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_input(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_input via a request object, either of type CreateInputRequest or an equivalent Hash.

  • #create_input(parent: nil, input: nil, input_id: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_input via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 1333

def create_input request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_input..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_input.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_input.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.create_input request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_asset(request, options = nil) ⇒ ::Gapic::Operation #delete_asset(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes the specified asset if it is not used.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.new

# Call the delete_asset method.
result = client.delete_asset request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_asset(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_asset via a request object, either of type DeleteAssetRequest or an equivalent Hash.

  • #delete_asset(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_asset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 3273

def delete_asset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_asset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_asset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_asset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.delete_asset request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_channel(request, options = nil) ⇒ ::Gapic::Operation #delete_channel(name: nil, request_id: nil, force: nil) ⇒ ::Gapic::Operation

Deletes the specified channel.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new

# Call the delete_channel method.
result = client.delete_channel request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_channel(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_channel via a request object, either of type DeleteChannelRequest or an equivalent Hash.

  • #delete_channel(name: nil, request_id: nil, force: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_channel via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 681

def delete_channel request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_channel..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_channel.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_channel.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.delete_channel request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_clip(request, options = nil) ⇒ ::Gapic::Operation #delete_clip(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes the specified clip job resource. This method only deletes the clip job and does not delete the VOD clip stored in Cloud Storage.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.new

# Call the delete_clip method.
result = client.delete_clip request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_clip(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_clip via a request object, either of type DeleteClipRequest or an equivalent Hash.

  • #delete_clip(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_clip via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 2564

def delete_clip request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_clip..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_clip.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_clip.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.delete_clip request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_dvr_session(request, options = nil) ⇒ ::Gapic::Operation #delete_dvr_session(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes the specified DVR session.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.new

# Call the delete_dvr_session method.
result = client.delete_dvr_session request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_dvr_session(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_dvr_session via a request object, either of type DeleteDvrSessionRequest or an equivalent Hash.

  • #delete_dvr_session(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_dvr_session via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 2949

def delete_dvr_session request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_dvr_session..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_dvr_session.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_dvr_session.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.delete_dvr_session request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_event(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_event(name: nil, request_id: nil) ⇒ ::Google::Protobuf::Empty

Deletes the specified event.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.new

# Call the delete_event method.
result = client.delete_event request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_event(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_event via a request object, either of type DeleteEventRequest or an equivalent Hash.

  • #delete_event(name: nil, request_id: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_event via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 2180

def delete_event request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_event..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_event.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_event.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.delete_event request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_input(request, options = nil) ⇒ ::Gapic::Operation #delete_input(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes the specified input.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.new

# Call the delete_input method.
result = client.delete_input request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_input(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_input via a request object, either of type DeleteInputRequest or an equivalent Hash.

  • #delete_input(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_input via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 1612

def delete_input request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_input..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_input.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_input.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.delete_input request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_asset(request, options = nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Asset #get_asset(name: nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Asset

Returns the specified asset.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new

# Call the get_asset method.
result = client.get_asset request

# The returned object is of type Google::Cloud::Video::LiveStream::V1::Asset.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 3354

def get_asset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_asset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_asset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_asset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.get_asset request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_channel(request, options = nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Channel #get_channel(name: nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Channel

Returns the specified channel.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new

# Call the get_channel method.
result = client.get_channel request

# The returned object is of type Google::Cloud::Video::LiveStream::V1::Channel.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 576

def get_channel request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_channel..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_channel.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_channel.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.get_channel request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_clip(request, options = nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Clip #get_clip(name: nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Clip

Returns the specified clip.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::GetClipRequest.new

# Call the get_clip method.
result = client.get_clip request

# The returned object is of type Google::Cloud::Video::LiveStream::V1::Clip.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 2352

def get_clip request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetClipRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_clip..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_clip.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_clip.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.get_clip request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_dvr_session(request, options = nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::DvrSession #get_dvr_session(name: nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::DvrSession

Returns the specified DVR session.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.new

# Call the get_dvr_session method.
result = client.get_dvr_session request

# The returned object is of type Google::Cloud::Video::LiveStream::V1::DvrSession.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 2849

def get_dvr_session request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_dvr_session..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_dvr_session.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_dvr_session.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.get_dvr_session request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_event(request, options = nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Event #get_event(name: nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Event

Returns the specified event.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::GetEventRequest.new

# Call the get_event method.
result = client.get_event request

# The returned object is of type Google::Cloud::Video::LiveStream::V1::Event.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 2087

def get_event request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetEventRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_event..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_event.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_event.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.get_event request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_input(request, options = nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Input #get_input(name: nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Input

Returns the specified input.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::GetInputRequest.new

# Call the get_input method.
result = client.get_input request

# The returned object is of type Google::Cloud::Video::LiveStream::V1::Input.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 1512

def get_input request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetInputRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_input..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_input.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_input.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.get_input request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_pool(request, options = nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Pool #get_pool(name: nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::Pool

Returns the specified pool.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new

# Call the get_pool method.
result = client.get_pool request

# The returned object is of type Google::Cloud::Video::LiveStream::V1::Pool.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 3527

def get_pool request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_pool..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_pool.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_pool.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.get_pool request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_assets(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Asset> #list_assets(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Asset>

Returns a list of all assets in the specified region.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.new

# Call the list_assets method.
result = client.list_assets request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Video::LiveStream::V1::Asset.
  p item
end

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 3446

def list_assets request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_assets..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_assets.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_assets.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.list_assets request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_assets, "assets", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_channels(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Channel> #list_channels(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Channel>

Returns a list of all channels in the specified region.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.new

# Call the list_channels method.
result = client.list_channels request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Video::LiveStream::V1::Channel.
  p item
end

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 495

def list_channels request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_channels..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_channels.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_channels.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.list_channels request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_channels, "channels", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_clips(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Clip> #list_clips(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Clip>

Returns a list of all clips in the specified channel.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::ListClipsRequest.new

# Call the list_clips method.
result = client.list_clips request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Video::LiveStream::V1::Clip.
  p item
end

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 2271

def list_clips request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_clips..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_clips.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_clips.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.list_clips request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_clips, "clips", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_dvr_sessions(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::DvrSession> #list_dvr_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::DvrSession>

Returns a list of all DVR sessions in the specified channel.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.new

# Call the list_dvr_sessions method.
result = client.list_dvr_sessions request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Video::LiveStream::V1::DvrSession.
  p item
end

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 2768

def list_dvr_sessions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_dvr_sessions..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_dvr_sessions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_dvr_sessions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.list_dvr_sessions request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_dvr_sessions, "dvr_sessions", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_events(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Event> #list_events(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Event>

Returns a list of all events in the specified channel.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::ListEventsRequest.new

# Call the list_events method.
result = client.list_events request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Video::LiveStream::V1::Event.
  p item
end

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 2006

def list_events request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_events..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_events.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_events.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.list_events request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_events, "events", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_inputs(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Input> #list_inputs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Input>

Returns a list of all inputs in the specified region.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::ListInputsRequest.new

# Call the list_inputs method.
result = client.list_inputs request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Video::LiveStream::V1::Input.
  p item
end

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 1431

def list_inputs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_inputs..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_inputs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_inputs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.list_inputs request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_inputs, "inputs", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.



316
317
318
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 316

def logger
  @livestream_service_stub.logger
end

#preview_input(request, options = nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse #preview_input(name: nil) ⇒ ::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse

Preview the streaming content of the specified input.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.new

# Call the preview_input method.
result = client.preview_input request

# The returned object is of type Google::Cloud::Video::LiveStream::V1::PreviewInputResponse.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 1808

def preview_input request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.preview_input..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.preview_input.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.preview_input.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.preview_input request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#start_channel(request, options = nil) ⇒ ::Gapic::Operation #start_channel(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Starts the specified channel. Part of the video pipeline will be created only when the StartChannel request is received by the server.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::StartChannelRequest.new

# Call the start_channel method.
result = client.start_channel request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #start_channel(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to start_channel via a request object, either of type StartChannelRequest or an equivalent Hash.

  • #start_channel(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to start_channel via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 906

def start_channel request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.start_channel..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.start_channel.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.start_channel.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.start_channel request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#start_distribution(request, options = nil) ⇒ ::Gapic::Operation #start_distribution(name: nil, distribution_keys: nil, request_id: nil) ⇒ ::Gapic::Operation

Starts distribution which delivers outputs to the destination indicated by the Distribution configuration.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new

# Call the start_distribution method.
result = client.start_distribution request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #start_distribution(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to start_distribution via a request object, either of type StartDistributionRequest or an equivalent Hash.

  • #start_distribution(name: nil, distribution_keys: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to start_distribution via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 1116

def start_distribution request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.start_distribution..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.start_distribution.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.start_distribution.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.start_distribution request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#stop_channel(request, options = nil) ⇒ ::Gapic::Operation #stop_channel(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Stops the specified channel. Part of the video pipeline will be released when the StopChannel request is received by the server.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::StopChannelRequest.new

# Call the stop_channel method.
result = client.stop_channel request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #stop_channel(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to stop_channel via a request object, either of type StopChannelRequest or an equivalent Hash.

  • #stop_channel(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to stop_channel via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 1009

def stop_channel request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.stop_channel..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.stop_channel.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.stop_channel.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.stop_channel request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#stop_distribution(request, options = nil) ⇒ ::Gapic::Operation #stop_distribution(name: nil, distribution_keys: nil, request_id: nil) ⇒ ::Gapic::Operation

Stops the specified distribution.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new

# Call the stop_distribution method.
result = client.stop_distribution request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #stop_distribution(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to stop_distribution via a request object, either of type StopDistributionRequest or an equivalent Hash.

  • #stop_distribution(name: nil, distribution_keys: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to stop_distribution via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 1222

def stop_distribution request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.stop_distribution..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.stop_distribution.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.stop_distribution.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.stop_distribution request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain



219
220
221
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 219

def universe_domain
  @livestream_service_stub.universe_domain
end

#update_channel(request, options = nil) ⇒ ::Gapic::Operation #update_channel(update_mask: nil, channel: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates the specified channel.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new

# Call the update_channel method.
result = client.update_channel request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_channel(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_channel via a request object, either of type UpdateChannelRequest or an equivalent Hash.

  • #update_channel(update_mask: nil, channel: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_channel via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 803

def update_channel request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_channel..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_channel.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_channel.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.update_channel request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_dvr_session(request, options = nil) ⇒ ::Gapic::Operation #update_dvr_session(update_mask: nil, dvr_session: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates the specified DVR session.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new

# Call the update_dvr_session method.
result = client.update_dvr_session request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_dvr_session(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_dvr_session via a request object, either of type UpdateDvrSessionRequest or an equivalent Hash.

  • #update_dvr_session(update_mask: nil, dvr_session: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_dvr_session via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 3059

def update_dvr_session request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_dvr_session..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_dvr_session.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_dvr_session.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.update_dvr_session request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_input(request, options = nil) ⇒ ::Gapic::Operation #update_input(update_mask: nil, input: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates the specified input.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new

# Call the update_input method.
result = client.update_input request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_input(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_input via a request object, either of type UpdateInputRequest or an equivalent Hash.

  • #update_input(update_mask: nil, input: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_input via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 1727

def update_input request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_input..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_input.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_input.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.update_input request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_pool(request, options = nil) ⇒ ::Gapic::Operation #update_pool(update_mask: nil, pool: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates the specified pool.

Examples:

Basic example

require "google/cloud/video/live_stream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new

# Call the update_pool method.
result = client.update_pool request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_pool(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_pool via a request object, either of type UpdatePoolRequest or an equivalent Hash.

  • #update_pool(update_mask: nil, pool: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_pool via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
# File 'lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb', line 3634

def update_pool request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_pool..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_pool.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_pool.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @livestream_service_stub.update_pool request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end