class Kaltura::KalturaCategoryService

Add & Manage Categories

Public Class Methods

new(client) click to toggle source
Calls superclass method
# File lib/kaltura_client.rb, line 905
def initialize(client)
        super(client)
end

Public Instance Methods

add(category) click to toggle source

Add new Category @return [KalturaCategory]

# 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) click to toggle source

@return [KalturaBulkUpload]

# 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) click to toggle source

Delete a Category @return []

# 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) click to toggle source

Get Category by id @return [KalturaCategory]

# 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) click to toggle source

Index Category by id @return [int]

# 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) click to toggle source

List all categories @return [KalturaCategoryListResponse]

# 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) click to toggle source

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

# 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() click to toggle source

Unlock categories @return []

# 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) click to toggle source

Update Category @return [KalturaCategory]

# 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