Class: Kaltura::KalturaCategoryService
- Inherits:
-
KalturaServiceBase
- Object
- KalturaServiceBase
- Kaltura::KalturaCategoryService
- Defined in:
- lib/kaltura_client.rb
Overview
Add & Manage Categories
Instance Attribute Summary
Attributes inherited from KalturaServiceBase
Instance Method Summary collapse
-
#add(category) ⇒ KalturaCategory
Add new Category.
- #add_from_bulk_upload(file_data, bulk_upload_data = KalturaNotImplemented, bulk_upload_category_data = KalturaNotImplemented) ⇒ KalturaBulkUpload
-
#delete(id, move_entries_to_parent_category = 1) ⇒ Object
Delete a Category.
-
#get(id) ⇒ KalturaCategory
Get Category by id.
-
#index(id, should_update = true) ⇒ int
Index Category by id.
-
#initialize(client) ⇒ KalturaCategoryService
constructor
A new instance of KalturaCategoryService.
-
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ KalturaCategoryListResponse
List all categories.
-
#move(category_ids, target_category_parent_id) ⇒ bool
Move categories that belong to the same parent category to a target categroy - enabled only for ks with disable entitlement.
-
#unlock_categories ⇒ Object
Unlock categories.
-
#update(id, category) ⇒ KalturaCategory
Update Category.
Constructor Details
#initialize(client) ⇒ KalturaCategoryService
Returns a new instance of KalturaCategoryService.
905 906 907 |
# File 'lib/kaltura_client.rb', line 905 def initialize(client) super(client) end |
Instance Method Details
#add(category) ⇒ KalturaCategory
Add new Category
911 912 913 914 915 916 917 918 919 |
# File 'lib/kaltura_client.rb', line 911 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
922 923 924 925 926 927 928 929 930 931 932 933 |
# File 'lib/kaltura_client.rb', line 922 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 |
#delete(id, move_entries_to_parent_category = 1) ⇒ Object
Delete a Category
937 938 939 940 941 942 943 944 945 946 |
# File 'lib/kaltura_client.rb', line 937 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) ⇒ KalturaCategory
Get Category by id
950 951 952 953 954 955 956 957 958 |
# File 'lib/kaltura_client.rb', line 950 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
962 963 964 965 966 967 968 969 970 971 |
# File 'lib/kaltura_client.rb', line 962 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
975 976 977 978 979 980 981 982 983 984 |
# File 'lib/kaltura_client.rb', line 975 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 categroy - enabled only for ks with disable entitlement
988 989 990 991 992 993 994 995 996 997 |
# File 'lib/kaltura_client.rb', line 988 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_categories ⇒ Object
Unlock categories
1001 1002 1003 1004 1005 1006 1007 1008 |
# File 'lib/kaltura_client.rb', line 1001 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
1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 |
# File 'lib/kaltura_client.rb', line 1012 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 |