Class: Kaltura::KalturaCategoryService

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

Overview

Add & Manage Categories

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaCategoryService

Returns a new instance of KalturaCategoryService.



9720
9721
9722
# File 'lib/kaltura_client.rb', line 9720

def initialize(client)
	super(client)
end

Instance Method Details

#add(category) ⇒ Object

Add new Category



9726
9727
9728
9729
9730
9731
9732
9733
9734
# File 'lib/kaltura_client.rb', line 9726

def add(category)
	kparams = {}
	client.add_param(kparams, 'category', category);
	client.queue_service_action_call('category', 'add', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#add_from_bulk_upload(file_data, bulk_upload_data = KalturaNotImplemented, bulk_upload_category_data = KalturaNotImplemented) ⇒ Object



9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
# File 'lib/kaltura_client.rb', line 9824

def add_from_bulk_upload(file_data, bulk_upload_data=KalturaNotImplemented, bulk_upload_category_data=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'fileData', file_data);
	client.add_param(kparams, 'bulkUploadData', bulk_upload_data);
	client.add_param(kparams, 'bulkUploadCategoryData', bulk_upload_category_data);
	client.queue_service_action_call('category', 'addFromBulkUpload', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#delete(id, move_entries_to_parent_category = 1) ⇒ Object

Delete a Category



9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
# File 'lib/kaltura_client.rb', line 9763

def delete(id, move_entries_to_parent_category=1)
	kparams = {}
	client.add_param(kparams, 'id', id);
	client.add_param(kparams, 'moveEntriesToParentCategory', move_entries_to_parent_category);
	client.queue_service_action_call('category', 'delete', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#get(id) ⇒ Object

Get Category by id



9738
9739
9740
9741
9742
9743
9744
9745
9746
# File 'lib/kaltura_client.rb', line 9738

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

#index(id, should_update = true) ⇒ Object

Index Category by id



9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
# File 'lib/kaltura_client.rb', line 9789

def index(id, should_update=true)
	kparams = {}
	client.add_param(kparams, 'id', id);
	client.add_param(kparams, 'shouldUpdate', should_update);
	client.queue_service_action_call('category', 'index', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

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

List all categories



9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
# File 'lib/kaltura_client.rb', line 9776

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

#move(category_ids, target_category_parent_id) ⇒ Object

Move categories that belong to the same parent category to a target categroy - enabled only for ks with disable entitlement



9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
# File 'lib/kaltura_client.rb', line 9802

def move(category_ids, target_category_parent_id)
	kparams = {}
	client.add_param(kparams, 'categoryIds', category_ids);
	client.add_param(kparams, 'targetCategoryParentId', target_category_parent_id);
	client.queue_service_action_call('category', 'move', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#unlock_categoriesObject

Unlock categories



9815
9816
9817
9818
9819
9820
9821
9822
# File 'lib/kaltura_client.rb', line 9815

def unlock_categories()
	kparams = {}
	client.queue_service_action_call('category', 'unlockCategories', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#update(id, category) ⇒ Object

Update Category



9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
# File 'lib/kaltura_client.rb', line 9750

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