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.



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

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/mux_ruby/api/assets_api.rb', line 17

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 (CreateAssetRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/mux_ruby/api/assets_api.rb', line 27

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 (String)

    The asset ID.

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

    the optional parameters

Returns:



92
93
94
95
# File 'lib/mux_ruby/api/assets_api.rb', line 92

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, Integer, Hash)>

Create a playback ID

Parameters:

  • asset_id (String)

    The asset ID.

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

    the optional parameters

Returns:

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

    CreatePlaybackIDResponse data, response status code and response headers



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

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' + '}', CGI.escape(asset_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_playback_id_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreatePlaybackIDResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"AssetsApi.create_asset_playback_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  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 (String)

    The asset ID.

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

    the optional parameters

Returns:



161
162
163
164
# File 'lib/mux_ruby/api/assets_api.rb', line 161

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, Integer, Hash)>

Create an asset track

Parameters:

  • asset_id (String)

    The asset ID.

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

    the optional parameters

Returns:

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

    CreateTrackResponse data, response status code and response headers



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/mux_ruby/api/assets_api.rb', line 171

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' + '}', CGI.escape(asset_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_track_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateTrackResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"AssetsApi.create_asset_track",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  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, Integer, Hash)>

Create an asset Create a new Mux Video asset.

Parameters:

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

    the optional parameters

Returns:

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

    AssetResponse data, response status code and response headers



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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/mux_ruby/api/assets_api.rb', line 37

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 = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_asset_request)

  # return_type
  return_type = opts[:debug_return_type] || 'AssetResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"AssetsApi.create_asset",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  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 Deletes a video asset and all its data.

Parameters:

  • asset_id (String)

    The asset ID.

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

    the optional parameters

Returns:

  • (nil)


230
231
232
233
# File 'lib/mux_ruby/api/assets_api.rb', line 230

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 (String)

    The asset ID.

  • playback_id (String)

    The live stream&#39;s playback ID.

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

    the optional parameters

Returns:

  • (nil)


291
292
293
294
# File 'lib/mux_ruby/api/assets_api.rb', line 291

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, Integer, Hash)>

Delete a playback ID

Parameters:

  • asset_id (String)

    The asset ID.

  • playback_id (String)

    The live stream&#39;s playback ID.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



301
302
303
304
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
343
344
345
346
347
348
349
# File 'lib/mux_ruby/api/assets_api.rb', line 301

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' + '}', CGI.escape(asset_id.to_s)).sub('{' + 'PLAYBACK_ID' + '}', CGI.escape(playback_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"AssetsApi.delete_asset_playback_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  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 Removes a text track from an asset. Audio and video tracks on assets cannot be removed.

Parameters:

  • asset_id (String)

    The asset ID.

  • track_id (String)

    The track ID.

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

    the optional parameters

Returns:

  • (nil)


357
358
359
360
# File 'lib/mux_ruby/api/assets_api.rb', line 357

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, Integer, Hash)>

Delete an asset track Removes a text track from an asset. Audio and video tracks on assets cannot be removed.

Parameters:

  • asset_id (String)

    The asset ID.

  • track_id (String)

    The track ID.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/mux_ruby/api/assets_api.rb', line 368

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' + '}', CGI.escape(asset_id.to_s)).sub('{' + 'TRACK_ID' + '}', CGI.escape(track_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"AssetsApi.delete_asset_track",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  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, Integer, Hash)>

Delete an asset Deletes a video asset and all its data.

Parameters:

  • asset_id (String)

    The asset ID.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

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' + '}', CGI.escape(asset_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"AssetsApi.delete_asset",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  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 (String)

    The asset ID.

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

    the optional parameters

Returns:



423
424
425
426
# File 'lib/mux_ruby/api/assets_api.rb', line 423

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 (String)

    The asset ID.

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

    the optional parameters

Returns:



486
487
488
489
# File 'lib/mux_ruby/api/assets_api.rb', line 486

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, Integer, 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 (String)

    The asset ID.

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

    the optional parameters

Returns:

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

    GetAssetInputInfoResponse data, response status code and response headers



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
531
532
533
534
535
536
537
538
539
540
541
542
# File 'lib/mux_ruby/api/assets_api.rb', line 496

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' + '}', CGI.escape(asset_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetAssetInputInfoResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"AssetsApi.get_asset_input_info",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  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 (String)

    The asset ID.

  • playback_id (String)

    The live stream&#39;s playback ID.

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

    the optional parameters

Returns:



549
550
551
552
# File 'lib/mux_ruby/api/assets_api.rb', line 549

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, Integer, Hash)>

Retrieve a playback ID

Parameters:

  • asset_id (String)

    The asset ID.

  • playback_id (String)

    The live stream&#39;s playback ID.

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

    the optional parameters

Returns:

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

    GetAssetPlaybackIDResponse data, response status code and response headers



559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
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
# File 'lib/mux_ruby/api/assets_api.rb', line 559

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' + '}', CGI.escape(asset_id.to_s)).sub('{' + 'PLAYBACK_ID' + '}', CGI.escape(playback_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetAssetPlaybackIDResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"AssetsApi.get_asset_playback_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  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, Integer, 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 (String)

    The asset ID.

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

    the optional parameters

Returns:

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

    AssetResponse data, response status code and response headers



433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
# File 'lib/mux_ruby/api/assets_api.rb', line 433

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' + '}', CGI.escape(asset_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AssetResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"AssetsApi.get_asset",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  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 List all Mux 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)

  • :live_stream_id (String)

    Filter response to return all the assets for this live stream only

  • :upload_id (String)

    Filter response to return an asset created from this direct upload only

Returns:



619
620
621
622
# File 'lib/mux_ruby/api/assets_api.rb', line 619

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

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

List assets List all Mux 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;

  • :live_stream_id (String)

    Filter response to return all the assets for this live stream only

  • :upload_id (String)

    Filter response to return an asset created from this direct upload only

Returns:

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

    ListAssetsResponse data, response status code and response headers



632
633
634
635
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 632

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 = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'live_stream_id'] = opts[:'live_stream_id'] if !opts[:'live_stream_id'].nil?
  query_params[:'upload_id'] = opts[:'upload_id'] if !opts[:'upload_id'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListAssetsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"AssetsApi.list_assets",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  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 to 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 (String)

    The asset ID.

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

    the optional parameters

Returns:



686
687
688
689
# File 'lib/mux_ruby/api/assets_api.rb', line 686

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, Integer, Hash)>

Update master access Allows you to 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 (String)

    The asset ID.

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

    the optional parameters

Returns:

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

    AssetResponse data, response status code and response headers



697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
# File 'lib/mux_ruby/api/assets_api.rb', line 697

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' + '}', CGI.escape(asset_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_asset_master_access_request)

  # return_type
  return_type = opts[:debug_return_type] || 'AssetResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"AssetsApi.update_asset_master_access",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  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 to 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 (String)

    The asset ID.

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

    the optional parameters

Returns:



757
758
759
760
# File 'lib/mux_ruby/api/assets_api.rb', line 757

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, Integer, Hash)>

Update MP4 support Allows you to 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 (String)

    The asset ID.

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

    the optional parameters

Returns:

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

    AssetResponse data, response status code and response headers



768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
# File 'lib/mux_ruby/api/assets_api.rb', line 768

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' + '}', CGI.escape(asset_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_asset_mp4_support_request)

  # return_type
  return_type = opts[:debug_return_type] || 'AssetResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"AssetsApi.update_asset_mp4_support",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  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