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.



915
916
917
# File 'lib/kaltura_client.rb', line 915

def initialize(client)
	super(client)
end

Instance Method Details

#add(category) ⇒ KalturaCategory

Add new Category

Returns:



921
922
923
924
925
926
927
928
929
# File 'lib/kaltura_client.rb', line 921

def add(category)
	kparams = {}
	client.add_param(kparams, 'category', category)
	client.queue_service_action_call('category', 'add', 'KalturaCategory', 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) ⇒ KalturaBulkUpload

Returns:



932
933
934
935
936
937
938
939
940
941
942
943
# File 'lib/kaltura_client.rb', line 932

def add_from_bulk_upload(file_data, bulk_upload_data=KalturaNotImplemented, bulk_upload_category_data=KalturaNotImplemented)
	kparams = {}
	kfiles = {}
	client.add_param(kfiles, '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', 'KalturaBulkUpload', kparams, kfiles)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#clone(category_id, from_partner_id, parent_category_id = KalturaNotImplemented) ⇒ KalturaCategory

Clone Category

Returns:



947
948
949
950
951
952
953
954
955
956
957
# File 'lib/kaltura_client.rb', line 947

def clone(category_id, from_partner_id, parent_category_id=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'categoryId', category_id)
	client.add_param(kparams, 'fromPartnerId', from_partner_id)
	client.add_param(kparams, 'parentCategoryId', parent_category_id)
	client.queue_service_action_call('category', 'clone', 'KalturaCategory', 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

Returns:



961
962
963
964
965
966
967
968
969
970
# File 'lib/kaltura_client.rb', line 961

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

#export_to_csv(filter = KalturaNotImplemented, metadata_profile_id = KalturaNotImplemented, additional_fields = KalturaNotImplemented, mapped_fields = KalturaNotImplemented, options = KalturaNotImplemented) ⇒ string

Creates a batch job that sends an email with a link to download a CSV containing a list of categories

Returns:

  • (string)


974
975
976
977
978
979
980
981
982
983
984
985
986
# File 'lib/kaltura_client.rb', line 974

def export_to_csv(filter=KalturaNotImplemented, =KalturaNotImplemented, additional_fields=KalturaNotImplemented, mapped_fields=KalturaNotImplemented, options=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'filter', filter)
	client.add_param(kparams, 'metadataProfileId', )
	client.add_param(kparams, 'additionalFields', additional_fields)
	client.add_param(kparams, 'mappedFields', mapped_fields)
	client.add_param(kparams, 'options', options)
	client.queue_service_action_call('category', 'exportToCsv', 'string', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#get(id) ⇒ KalturaCategory

Get Category by id

Returns:



990
991
992
993
994
995
996
997
998
# File 'lib/kaltura_client.rb', line 990

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

#index(id, should_update = true) ⇒ int

Index Category by id

Returns:

  • (int)


1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
# File 'lib/kaltura_client.rb', line 1002

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', 'int', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

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

List all categories



1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
# File 'lib/kaltura_client.rb', line 1015

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', 'KalturaCategoryListResponse', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#move(category_ids, target_category_parent_id) ⇒ bool

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

Returns:

  • (bool)


1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
# File 'lib/kaltura_client.rb', line 1028

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', 'bool', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#unlock_categoriesObject

Unlock categories

Returns:



1041
1042
1043
1044
1045
1046
1047
1048
# File 'lib/kaltura_client.rb', line 1041

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) ⇒ KalturaCategory

Update Category

Returns:



1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
# File 'lib/kaltura_client.rb', line 1052

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