Class: Kaltura::KalturaDataService

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

Overview

Data service lets you manage data content (textual content)

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaDataService

Returns a new instance of KalturaDataService.



10108
10109
10110
# File 'lib/kaltura_client.rb', line 10108

def initialize(client)
	super(client)
end

Instance Method Details

#add(data_entry) ⇒ Object

Adds a new data entry



10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
# File 'lib/kaltura_client.rb', line 10114

def add(data_entry)
	kparams = {}
	# Data entry
	client.add_param(kparams, 'dataEntry', data_entry);
	client.queue_service_action_call('data', 'add', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#delete(entry_id) ⇒ Object

Delete a data entry.



10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
# File 'lib/kaltura_client.rb', line 10157

def delete(entry_id)
	kparams = {}
	# Data entry id to delete
	client.add_param(kparams, 'entryId', entry_id);
	client.queue_service_action_call('data', 'delete', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#get(entry_id, version = -1)) ⇒ Object

Get data entry by ID.



10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
# File 'lib/kaltura_client.rb', line 10127

def get(entry_id, version=-1)
	kparams = {}
	# Data entry id
	client.add_param(kparams, 'entryId', entry_id);
	# Desired version of the data
	client.add_param(kparams, 'version', version);
	client.queue_service_action_call('data', 'get', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object

List data entries by filter with paging support.



10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
# File 'lib/kaltura_client.rb', line 10170

def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
	kparams = {}
	# Document entry filter
	client.add_param(kparams, 'filter', filter);
	# Pager
	client.add_param(kparams, 'pager', pager);
	client.queue_service_action_call('data', 'list', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#serve(entry_id, version = -1,, force_proxy = false) ⇒ Object

serve action returan the file from dataContent field.



10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
# File 'lib/kaltura_client.rb', line 10185

def serve(entry_id, version=-1, force_proxy=false)
	kparams = {}
	# Data entry id
	client.add_param(kparams, 'entryId', entry_id);
	# Desired version of the data
	client.add_param(kparams, 'version', version);
	# force to get the content without redirect
	client.add_param(kparams, 'forceProxy', force_proxy);
	client.queue_service_action_call('data', 'serve', kparams);
	return client.get_serve_url();
end

#update(entry_id, document_entry) ⇒ Object

Update data entry. Only the properties that were set will be updated.



10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
# File 'lib/kaltura_client.rb', line 10142

def update(entry_id, document_entry)
	kparams = {}
	# Data entry id to update
	client.add_param(kparams, 'entryId', entry_id);
	# Data entry metadata to update
	client.add_param(kparams, 'documentEntry', document_entry);
	client.queue_service_action_call('data', 'update', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end