Class: Kaltura::KalturaFileAssetService

Inherits:
KalturaServiceBase show all
Defined in:
lib/kaltura_client.rb

Overview

Manage file assets

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaFileAssetService

Returns a new instance of KalturaFileAssetService.



1609
1610
1611
# File 'lib/kaltura_client.rb', line 1609

def initialize(client)
  super(client)
end

Instance Method Details

#add(file_asset) ⇒ KalturaFileAsset

Add new file asset

Returns:



1615
1616
1617
1618
1619
1620
1621
1622
1623
# File 'lib/kaltura_client.rb', line 1615

def add(file_asset)
  kparams = {}
  client.add_param(kparams, 'fileAsset', file_asset)
  client.queue_service_action_call('fileasset', 'add', 'KalturaFileAsset', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#delete(id) ⇒ Object

Delete file asset by id

Returns:



1627
1628
1629
1630
1631
1632
1633
1634
1635
# File 'lib/kaltura_client.rb', line 1627

def delete(id)
  kparams = {}
  client.add_param(kparams, 'id', id)
  client.queue_service_action_call('fileasset', 'delete', '', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#get(id) ⇒ KalturaFileAsset

Get file asset by id

Returns:



1639
1640
1641
1642
1643
1644
1645
1646
1647
# File 'lib/kaltura_client.rb', line 1639

def get(id)
  kparams = {}
  client.add_param(kparams, 'id', id)
  client.queue_service_action_call('fileasset', 'get', 'KalturaFileAsset', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#list(filter, pager = KalturaNotImplemented) ⇒ KalturaFileAssetListResponse

List file assets by filter and pager



1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
# File 'lib/kaltura_client.rb', line 1651

def list(filter, pager=KalturaNotImplemented)
  kparams = {}
  client.add_param(kparams, 'filter', filter)
  client.add_param(kparams, 'pager', pager)
  client.queue_service_action_call('fileasset', 'list', 'KalturaFileAssetListResponse', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#serve(id) ⇒ file

Serve file asset by id

Returns:

  • (file)


1664
1665
1666
1667
1668
1669
# File 'lib/kaltura_client.rb', line 1664

def serve(id)
  kparams = {}
  client.add_param(kparams, 'id', id)
  client.queue_service_action_call('fileasset', 'serve', 'file', kparams)
  return client.get_serve_url()
end

#set_content(id, content_resource) ⇒ KalturaFileAsset

Set content of file asset

Returns:



1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
# File 'lib/kaltura_client.rb', line 1673

def set_content(id, content_resource)
  kparams = {}
  client.add_param(kparams, 'id', id)
  client.add_param(kparams, 'contentResource', content_resource)
  client.queue_service_action_call('fileasset', 'setContent', 'KalturaFileAsset', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#update(id, file_asset) ⇒ KalturaFileAsset

Update file asset by id

Returns:



1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
# File 'lib/kaltura_client.rb', line 1686

def update(id, file_asset)
  kparams = {}
  client.add_param(kparams, 'id', id)
  client.add_param(kparams, 'fileAsset', file_asset)
  client.queue_service_action_call('fileasset', 'update', 'KalturaFileAsset', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end