Class: MuxRuby::AssetsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mux_ruby/api/assets_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AssetsApi

Returns a new instance of AssetsApi.



12
13
14
# File 'lib/mux_ruby/api/assets_api.rb', line 12

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



10
11
12
# File 'lib/mux_ruby/api/assets_api.rb', line 10

def api_client
  @api_client
end

Instance Method Details

#create_asset(create_asset_request, opts = {}) ⇒ AssetResponse

Create an asset Create a new Mux Video asset.

Parameters:

  • create_asset_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



20
21
22
23
# File 'lib/mux_ruby/api/assets_api.rb', line 20

def create_asset(create_asset_request, opts = {})
  data, _status_code, _headers = create_asset_with_http_info(create_asset_request, opts)
  data
end

#create_asset_playback_id(asset_id, create_playback_id_request, opts = {}) ⇒ CreatePlaybackIDResponse

Create a playback ID

Parameters:

  • asset_id

    The asset ID.

  • create_playback_id_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



75
76
77
78
# File 'lib/mux_ruby/api/assets_api.rb', line 75

def create_asset_playback_id(asset_id, create_playback_id_request, opts = {})
  data, _status_code, _headers = create_asset_playback_id_with_http_info(asset_id, create_playback_id_request, opts)
  data
end

#create_asset_playback_id_with_http_info(asset_id, create_playback_id_request, opts = {}) ⇒ Array<(CreatePlaybackIDResponse, Fixnum, Hash)>

Create a playback ID

Parameters:

  • asset_id

    The asset ID.

  • create_playback_id_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreatePlaybackIDResponse, Fixnum, Hash)>)

    CreatePlaybackIDResponse data, response status code and response headers



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
# File 'lib/mux_ruby/api/assets_api.rb', line 85

def create_asset_playback_id_with_http_info(asset_id, create_playback_id_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssetsApi.create_asset_playback_id ...'
  end
  # verify the required parameter 'asset_id' is set
  if @api_client.config.client_side_validation && asset_id.nil?
    fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.create_asset_playback_id"
  end
  # verify the required parameter 'create_playback_id_request' is set
  if @api_client.config.client_side_validation && create_playback_id_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_playback_id_request' when calling AssetsApi.create_asset_playback_id"
  end
  # resource path
  local_var_path = '/video/v1/assets/{ASSET_ID}/playback-ids'.sub('{' + 'ASSET_ID' + '}', asset_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(create_playback_id_request)
  auth_names = ['accessToken']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreatePlaybackIDResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#create_asset_playback_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_asset_track(asset_id, create_track_request, opts = {}) ⇒ CreateTrackResponse

Create an asset track

Parameters:

  • asset_id

    The asset ID.

  • create_track_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



134
135
136
137
# File 'lib/mux_ruby/api/assets_api.rb', line 134

def create_asset_track(asset_id, create_track_request, opts = {})
  data, _status_code, _headers = create_asset_track_with_http_info(asset_id, create_track_request, opts)
  data
end

#create_asset_track_with_http_info(asset_id, create_track_request, opts = {}) ⇒ Array<(CreateTrackResponse, Fixnum, Hash)>

Create an asset track

Parameters:

  • asset_id

    The asset ID.

  • create_track_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateTrackResponse, Fixnum, Hash)>)

    CreateTrackResponse data, response status code and response headers



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
# File 'lib/mux_ruby/api/assets_api.rb', line 144

def create_asset_track_with_http_info(asset_id, create_track_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssetsApi.create_asset_track ...'
  end
  # verify the required parameter 'asset_id' is set
  if @api_client.config.client_side_validation && asset_id.nil?
    fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.create_asset_track"
  end
  # verify the required parameter 'create_track_request' is set
  if @api_client.config.client_side_validation && create_track_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_track_request' when calling AssetsApi.create_asset_track"
  end
  # resource path
  local_var_path = '/video/v1/assets/{ASSET_ID}/tracks'.sub('{' + 'ASSET_ID' + '}', asset_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(create_track_request)
  auth_names = ['accessToken']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateTrackResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#create_asset_track\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_asset_with_http_info(create_asset_request, opts = {}) ⇒ Array<(AssetResponse, Fixnum, Hash)>

Create an asset Create a new Mux Video asset.

Parameters:

  • create_asset_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AssetResponse, Fixnum, Hash)>)

    AssetResponse data, response status code and response headers



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/mux_ruby/api/assets_api.rb', line 30

def create_asset_with_http_info(create_asset_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssetsApi.create_asset ...'
  end
  # verify the required parameter 'create_asset_request' is set
  if @api_client.config.client_side_validation && create_asset_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_asset_request' when calling AssetsApi.create_asset"
  end
  # resource path
  local_var_path = '/video/v1/assets'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(create_asset_request)
  auth_names = ['accessToken']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AssetResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#create_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_asset(asset_id, opts = {}) ⇒ nil

Delete an asset

Parameters:

  • asset_id

    The asset ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


192
193
194
195
# File 'lib/mux_ruby/api/assets_api.rb', line 192

def delete_asset(asset_id, opts = {})
  delete_asset_with_http_info(asset_id, opts)
  nil
end

#delete_asset_playback_id(asset_id, playback_id, opts = {}) ⇒ nil

Delete a playback ID

Parameters:

  • asset_id

    The asset ID.

  • playback_id

    The live stream&#39;s playback ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


241
242
243
244
# File 'lib/mux_ruby/api/assets_api.rb', line 241

def delete_asset_playback_id(asset_id, playback_id, opts = {})
  delete_asset_playback_id_with_http_info(asset_id, playback_id, opts)
  nil
end

#delete_asset_playback_id_with_http_info(asset_id, playback_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a playback ID

Parameters:

  • asset_id

    The asset ID.

  • playback_id

    The live stream&#39;s playback ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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
# File 'lib/mux_ruby/api/assets_api.rb', line 251

def delete_asset_playback_id_with_http_info(asset_id, playback_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssetsApi.delete_asset_playback_id ...'
  end
  # verify the required parameter 'asset_id' is set
  if @api_client.config.client_side_validation && asset_id.nil?
    fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.delete_asset_playback_id"
  end
  # verify the required parameter 'playback_id' is set
  if @api_client.config.client_side_validation && playback_id.nil?
    fail ArgumentError, "Missing the required parameter 'playback_id' when calling AssetsApi.delete_asset_playback_id"
  end
  # resource path
  local_var_path = '/video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID}'.sub('{' + 'ASSET_ID' + '}', asset_id.to_s).sub('{' + 'PLAYBACK_ID' + '}', playback_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['accessToken']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#delete_asset_playback_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_asset_track(asset_id, track_id, opts = {}) ⇒ nil

Delete an asset track

Parameters:

  • asset_id

    The asset ID.

  • track_id

    The track ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


295
296
297
298
# File 'lib/mux_ruby/api/assets_api.rb', line 295

def delete_asset_track(asset_id, track_id, opts = {})
  delete_asset_track_with_http_info(asset_id, track_id, opts)
  nil
end

#delete_asset_track_with_http_info(asset_id, track_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete an asset track

Parameters:

  • asset_id

    The asset ID.

  • track_id

    The track ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/mux_ruby/api/assets_api.rb', line 305

def delete_asset_track_with_http_info(asset_id, track_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssetsApi.delete_asset_track ...'
  end
  # verify the required parameter 'asset_id' is set
  if @api_client.config.client_side_validation && asset_id.nil?
    fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.delete_asset_track"
  end
  # verify the required parameter 'track_id' is set
  if @api_client.config.client_side_validation && track_id.nil?
    fail ArgumentError, "Missing the required parameter 'track_id' when calling AssetsApi.delete_asset_track"
  end
  # resource path
  local_var_path = '/video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID}'.sub('{' + 'ASSET_ID' + '}', asset_id.to_s).sub('{' + 'TRACK_ID' + '}', track_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['accessToken']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#delete_asset_track\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_asset_with_http_info(asset_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete an asset

Parameters:

  • asset_id

    The asset ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/mux_ruby/api/assets_api.rb', line 201

def delete_asset_with_http_info(asset_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssetsApi.delete_asset ...'
  end
  # verify the required parameter 'asset_id' is set
  if @api_client.config.client_side_validation && asset_id.nil?
    fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.delete_asset"
  end
  # resource path
  local_var_path = '/video/v1/assets/{ASSET_ID}'.sub('{' + 'ASSET_ID' + '}', asset_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['accessToken']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#delete_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_asset(asset_id, opts = {}) ⇒ AssetResponse

Retrieve an asset Retrieves the details of an asset that has previously been created. Supply the unique asset ID that was returned from your previous request, and Mux will return the corresponding asset information. The same information is returned when creating an asset.

Parameters:

  • asset_id

    The asset ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



349
350
351
352
# File 'lib/mux_ruby/api/assets_api.rb', line 349

def get_asset(asset_id, opts = {})
  data, _status_code, _headers = get_asset_with_http_info(asset_id, opts)
  data
end

#get_asset_input_info(asset_id, opts = {}) ⇒ GetAssetInputInfoResponse

Retrieve asset input info Returns a list of the input objects that were used to create the asset along with any settings that were applied to each input.

Parameters:

  • asset_id

    The asset ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



402
403
404
405
# File 'lib/mux_ruby/api/assets_api.rb', line 402

def get_asset_input_info(asset_id, opts = {})
  data, _status_code, _headers = get_asset_input_info_with_http_info(asset_id, opts)
  data
end

#get_asset_input_info_with_http_info(asset_id, opts = {}) ⇒ Array<(GetAssetInputInfoResponse, Fixnum, Hash)>

Retrieve asset input info Returns a list of the input objects that were used to create the asset along with any settings that were applied to each input.

Parameters:

  • asset_id

    The asset ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetAssetInputInfoResponse, Fixnum, Hash)>)

    GetAssetInputInfoResponse data, response status code and response headers



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
# File 'lib/mux_ruby/api/assets_api.rb', line 412

def get_asset_input_info_with_http_info(asset_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssetsApi.get_asset_input_info ...'
  end
  # verify the required parameter 'asset_id' is set
  if @api_client.config.client_side_validation && asset_id.nil?
    fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.get_asset_input_info"
  end
  # resource path
  local_var_path = '/video/v1/assets/{ASSET_ID}/input-info'.sub('{' + 'ASSET_ID' + '}', asset_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['accessToken']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetAssetInputInfoResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#get_asset_input_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_asset_playback_id(asset_id, playback_id, opts = {}) ⇒ GetAssetPlaybackIDResponse

Retrieve a playback ID

Parameters:

  • asset_id

    The asset ID.

  • playback_id

    The live stream&#39;s playback ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



455
456
457
458
# File 'lib/mux_ruby/api/assets_api.rb', line 455

def get_asset_playback_id(asset_id, playback_id, opts = {})
  data, _status_code, _headers = get_asset_playback_id_with_http_info(asset_id, playback_id, opts)
  data
end

#get_asset_playback_id_with_http_info(asset_id, playback_id, opts = {}) ⇒ Array<(GetAssetPlaybackIDResponse, Fixnum, Hash)>

Retrieve a playback ID

Parameters:

  • asset_id

    The asset ID.

  • playback_id

    The live stream&#39;s playback ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetAssetPlaybackIDResponse, Fixnum, Hash)>)

    GetAssetPlaybackIDResponse data, response status code and response headers



465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
# File 'lib/mux_ruby/api/assets_api.rb', line 465

def get_asset_playback_id_with_http_info(asset_id, playback_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssetsApi.get_asset_playback_id ...'
  end
  # verify the required parameter 'asset_id' is set
  if @api_client.config.client_side_validation && asset_id.nil?
    fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.get_asset_playback_id"
  end
  # verify the required parameter 'playback_id' is set
  if @api_client.config.client_side_validation && playback_id.nil?
    fail ArgumentError, "Missing the required parameter 'playback_id' when calling AssetsApi.get_asset_playback_id"
  end
  # resource path
  local_var_path = '/video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID}'.sub('{' + 'ASSET_ID' + '}', asset_id.to_s).sub('{' + 'PLAYBACK_ID' + '}', playback_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['accessToken']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetAssetPlaybackIDResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#get_asset_playback_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_asset_with_http_info(asset_id, opts = {}) ⇒ Array<(AssetResponse, Fixnum, Hash)>

Retrieve an asset Retrieves the details of an asset that has previously been created. Supply the unique asset ID that was returned from your previous request, and Mux will return the corresponding asset information. The same information is returned when creating an asset.

Parameters:

  • asset_id

    The asset ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AssetResponse, Fixnum, Hash)>)

    AssetResponse data, response status code and response headers



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/mux_ruby/api/assets_api.rb', line 359

def get_asset_with_http_info(asset_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssetsApi.get_asset ...'
  end
  # verify the required parameter 'asset_id' is set
  if @api_client.config.client_side_validation && asset_id.nil?
    fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.get_asset"
  end
  # resource path
  local_var_path = '/video/v1/assets/{ASSET_ID}'.sub('{' + 'ASSET_ID' + '}', asset_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['accessToken']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AssetResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#get_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_assets(opts = {}) ⇒ ListAssetsResponse

List assets

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of items to include in the response (default to 25)

  • :page (Integer)

    Offset by this many pages, of the size of &#x60;limit&#x60; (default to 1)

Returns:



512
513
514
515
# File 'lib/mux_ruby/api/assets_api.rb', line 512

def list_assets(opts = {})
  data, _status_code, _headers = list_assets_with_http_info(opts)
  data
end

#list_assets_with_http_info(opts = {}) ⇒ Array<(ListAssetsResponse, Fixnum, Hash)>

List assets

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of items to include in the response

  • :page (Integer)

    Offset by this many pages, of the size of &#x60;limit&#x60;

Returns:

  • (Array<(ListAssetsResponse, Fixnum, Hash)>)

    ListAssetsResponse data, response status code and response headers



522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
# File 'lib/mux_ruby/api/assets_api.rb', line 522

def list_assets_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssetsApi.list_assets ...'
  end
  # resource path
  local_var_path = '/video/v1/assets'

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['accessToken']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListAssetsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#list_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_asset_master_access(asset_id, update_asset_master_access_request, opts = {}) ⇒ AssetResponse

Update master access Allows you add temporary access to the master (highest-quality) version of the asset in MP4 format. A URL will be created that can be used to download the master version for 24 hours. After 24 hours Master Access will revert to "none". This master version is not optimized for web and not meant to be streamed, only downloaded for purposes like archiving or editing the video offline.

Parameters:

  • asset_id

    The asset ID.

  • update_asset_master_access_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



564
565
566
567
# File 'lib/mux_ruby/api/assets_api.rb', line 564

def update_asset_master_access(asset_id, update_asset_master_access_request, opts = {})
  data, _status_code, _headers = update_asset_master_access_with_http_info(asset_id, update_asset_master_access_request, opts)
  data
end

#update_asset_master_access_with_http_info(asset_id, update_asset_master_access_request, opts = {}) ⇒ Array<(AssetResponse, Fixnum, Hash)>

Update master access Allows you add temporary access to the master (highest-quality) version of the asset in MP4 format. A URL will be created that can be used to download the master version for 24 hours. After 24 hours Master Access will revert to &quot;none&quot;. This master version is not optimized for web and not meant to be streamed, only downloaded for purposes like archiving or editing the video offline.

Parameters:

  • asset_id

    The asset ID.

  • update_asset_master_access_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AssetResponse, Fixnum, Hash)>)

    AssetResponse data, response status code and response headers



575
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
610
611
612
613
614
615
616
617
# File 'lib/mux_ruby/api/assets_api.rb', line 575

def update_asset_master_access_with_http_info(asset_id, update_asset_master_access_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssetsApi.update_asset_master_access ...'
  end
  # verify the required parameter 'asset_id' is set
  if @api_client.config.client_side_validation && asset_id.nil?
    fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.update_asset_master_access"
  end
  # verify the required parameter 'update_asset_master_access_request' is set
  if @api_client.config.client_side_validation && update_asset_master_access_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_asset_master_access_request' when calling AssetsApi.update_asset_master_access"
  end
  # resource path
  local_var_path = '/video/v1/assets/{ASSET_ID}/master-access'.sub('{' + 'ASSET_ID' + '}', asset_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(update_asset_master_access_request)
  auth_names = ['accessToken']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AssetResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#update_asset_master_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_asset_mp4_support(asset_id, update_asset_mp4_support_request, opts = {}) ⇒ AssetResponse

Update MP4 support Allows you add or remove mp4 support for assets that were created without it. Currently there are two values supported in this request, ‘standard` and `none`. `none` means that an asset *does not* have mp4 support, so submitting a request with `mp4_support` set to `none` will delete the mp4 assets from the asset in question.

Parameters:

  • asset_id

    The asset ID.

  • update_asset_mp4_support_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



625
626
627
628
# File 'lib/mux_ruby/api/assets_api.rb', line 625

def update_asset_mp4_support(asset_id, update_asset_mp4_support_request, opts = {})
  data, _status_code, _headers = update_asset_mp4_support_with_http_info(asset_id, update_asset_mp4_support_request, opts)
  data
end

#update_asset_mp4_support_with_http_info(asset_id, update_asset_mp4_support_request, opts = {}) ⇒ Array<(AssetResponse, Fixnum, Hash)>

Update MP4 support Allows you add or remove mp4 support for assets that were created without it. Currently there are two values supported in this request, &#x60;standard&#x60; and &#x60;none&#x60;. &#x60;none&#x60; means that an asset *does not* have mp4 support, so submitting a request with &#x60;mp4_support&#x60; set to &#x60;none&#x60; will delete the mp4 assets from the asset in question.

Parameters:

  • asset_id

    The asset ID.

  • update_asset_mp4_support_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AssetResponse, Fixnum, Hash)>)

    AssetResponse data, response status code and response headers



636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
# File 'lib/mux_ruby/api/assets_api.rb', line 636

def update_asset_mp4_support_with_http_info(asset_id, update_asset_mp4_support_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssetsApi.update_asset_mp4_support ...'
  end
  # verify the required parameter 'asset_id' is set
  if @api_client.config.client_side_validation && asset_id.nil?
    fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.update_asset_mp4_support"
  end
  # verify the required parameter 'update_asset_mp4_support_request' is set
  if @api_client.config.client_side_validation && update_asset_mp4_support_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_asset_mp4_support_request' when calling AssetsApi.update_asset_mp4_support"
  end
  # resource path
  local_var_path = '/video/v1/assets/{ASSET_ID}/mp4-support'.sub('{' + 'ASSET_ID' + '}', asset_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(update_asset_mp4_support_request)
  auth_names = ['accessToken']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AssetResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#update_asset_mp4_support\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end