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.



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

def initialize(client)
	super(client)
end

Instance Method Details

#add(file_asset) ⇒ KalturaFileAsset

Add new file asset

Returns:



1671
1672
1673
1674
1675
1676
1677
1678
1679
# File 'lib/kaltura_client.rb', line 1671

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:



1683
1684
1685
1686
1687
1688
1689
1690
1691
# File 'lib/kaltura_client.rb', line 1683

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:



1695
1696
1697
1698
1699
1700
1701
1702
1703
# File 'lib/kaltura_client.rb', line 1695

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



1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
# File 'lib/kaltura_client.rb', line 1707

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)


1720
1721
1722
1723
1724
1725
# File 'lib/kaltura_client.rb', line 1720

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:



1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
# File 'lib/kaltura_client.rb', line 1729

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:



1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
# File 'lib/kaltura_client.rb', line 1742

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