Class: Kaltura::KalturaBaseEntryService

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

Overview

Base Entry Service

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaBaseEntryService

Returns a new instance of KalturaBaseEntryService.



9199
9200
9201
# File 'lib/kaltura_client.rb', line 9199

def initialize(client)
	super(client)
end

Instance Method Details

#add(entry, type = KalturaNotImplemented) ⇒ Object

Generic add entry, should be used when the uploaded entry type is not known.



9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
# File 'lib/kaltura_client.rb', line 9205

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

#add_content(entry_id, resource) ⇒ Object

Attach content resource to entry in status NO_MEDIA



9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
# File 'lib/kaltura_client.rb', line 9218

def add_content(entry_id, resource)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id);
	client.add_param(kparams, 'resource', resource);
	client.queue_service_action_call('baseentry', 'addContent', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#add_from_uploaded_file(entry, upload_token_id, type = KalturaNotImplemented) ⇒ Object

Generic add entry using an uploaded file, should be used when the uploaded entry type is not known.



9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
# File 'lib/kaltura_client.rb', line 9231

def add_from_uploaded_file(entry, upload_token_id, type=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'entry', entry);
	client.add_param(kparams, 'uploadTokenId', upload_token_id);
	client.add_param(kparams, 'type', type);
	client.queue_service_action_call('baseentry', 'addFromUploadedFile', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#anonymous_rank(entry_id, rank) ⇒ Object

Anonymously rank an entry, no validation is done on duplicate rankings.



9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
# File 'lib/kaltura_client.rb', line 9482

def anonymous_rank(entry_id, rank)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id);
	client.add_param(kparams, 'rank', rank);
	client.queue_service_action_call('baseentry', 'anonymousRank', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#approve(entry_id) ⇒ Object

Approve the entry and mark the pending flags (if any) as moderated (this will make the entry playable).



9457
9458
9459
9460
9461
9462
9463
9464
9465
# File 'lib/kaltura_client.rb', line 9457

def approve(entry_id)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id);
	client.queue_service_action_call('baseentry', 'approve', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#clone(entry_id) ⇒ Object

Clone an entry with optional attributes to apply to the clone



9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
# File 'lib/kaltura_client.rb', line 9532

def clone(entry_id)
	kparams = {}
	# Id of entry to clone
	client.add_param(kparams, 'entryId', entry_id);
	client.queue_service_action_call('baseentry', 'clone', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#count(filter = KalturaNotImplemented) ⇒ Object

Count base entries by filter.



9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
# File 'lib/kaltura_client.rb', line 9360

def count(filter=KalturaNotImplemented)
	kparams = {}
	# Entry filter
	client.add_param(kparams, 'filter', filter);
	client.queue_service_action_call('baseentry', 'count', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#delete(entry_id) ⇒ Object

Delete an entry.



9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
# File 'lib/kaltura_client.rb', line 9317

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

#export(entry_id, storage_profile_id) ⇒ Object



9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
# File 'lib/kaltura_client.rb', line 9506

def export(entry_id, storage_profile_id)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id);
	client.add_param(kparams, 'storageProfileId', storage_profile_id);
	client.queue_service_action_call('baseentry', 'export', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#flag(moderation_flag) ⇒ Object

Flag inappropriate entry for moderation.



9433
9434
9435
9436
9437
9438
9439
9440
9441
# File 'lib/kaltura_client.rb', line 9433

def flag(moderation_flag)
	kparams = {}
	client.add_param(kparams, 'moderationFlag', moderation_flag);
	client.queue_service_action_call('baseentry', 'flag', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

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

Get base entry by ID.



9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
# File 'lib/kaltura_client.rb', line 9245

def get(entry_id, version=-1)
	kparams = {}
	# 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('baseentry', 'get', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#get_by_ids(entry_ids) ⇒ Object

Get an array of KalturaBaseEntry objects by a comma-separated list of ids.



9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
# File 'lib/kaltura_client.rb', line 9304

def get_by_ids(entry_ids)
	kparams = {}
	# Comma separated string of entry ids
	client.add_param(kparams, 'entryIds', entry_ids);
	client.queue_service_action_call('baseentry', 'getByIds', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#get_context_data(entry_id, context_data_params) ⇒ Object

This action delivers entry-related data, based on the user’s context: access control, restriction, playback format and storage information.



9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
# File 'lib/kaltura_client.rb', line 9495

def get_context_data(entry_id, context_data_params)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id);
	client.add_param(kparams, 'contextDataParams', context_data_params);
	client.queue_service_action_call('baseentry', 'getContextData', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#get_remote_paths(entry_id) ⇒ Object

Get remote storage existing paths for the asset.



9260
9261
9262
9263
9264
9265
9266
9267
9268
# File 'lib/kaltura_client.rb', line 9260

def get_remote_paths(entry_id)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id);
	client.queue_service_action_call('baseentry', 'getRemotePaths', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#index(id, should_update = true) ⇒ Object

Index an entry by id.



9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
# File 'lib/kaltura_client.rb', line 9519

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

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

List base entries by filter with paging support.



9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
# File 'lib/kaltura_client.rb', line 9330

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

#list_by_reference_id(ref_id, pager = KalturaNotImplemented) ⇒ Object

List base entries by filter according to reference id



9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
# File 'lib/kaltura_client.rb', line 9345

def list_by_reference_id(ref_id, pager=KalturaNotImplemented)
	kparams = {}
	# Entry Reference ID
	client.add_param(kparams, 'refId', ref_id);
	# Pager
	client.add_param(kparams, 'pager', pager);
	client.queue_service_action_call('baseentry', 'listByReferenceId', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#list_flags(entry_id, pager = KalturaNotImplemented) ⇒ Object

List all pending flags for the entry.



9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
# File 'lib/kaltura_client.rb', line 9469

def list_flags(entry_id, pager=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id);
	client.add_param(kparams, 'pager', pager);
	client.queue_service_action_call('baseentry', 'listFlags', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#reject(entry_id) ⇒ Object

Reject the entry and mark the pending flags (if any) as moderated (this will make the entry non-playable).



9445
9446
9447
9448
9449
9450
9451
9452
9453
# File 'lib/kaltura_client.rb', line 9445

def reject(entry_id)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id);
	client.queue_service_action_call('baseentry', 'reject', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#update(entry_id, base_entry) ⇒ Object

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



9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
# File 'lib/kaltura_client.rb', line 9272

def update(entry_id, base_entry)
	kparams = {}
	# Entry id to update
	client.add_param(kparams, 'entryId', entry_id);
	# Base entry metadata to update
	client.add_param(kparams, 'baseEntry', base_entry);
	client.queue_service_action_call('baseentry', 'update', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#update_content(entry_id, resource, conversion_profile_id = KalturaNotImplemented) ⇒ Object

Update the content resource associated with the entry.



9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
# File 'lib/kaltura_client.rb', line 9287

def update_content(entry_id, resource, conversion_profile_id=KalturaNotImplemented)
	kparams = {}
	# Entry id to update
	client.add_param(kparams, 'entryId', entry_id);
	# Resource to be used to replace entry content
	client.add_param(kparams, 'resource', resource);
	# The conversion profile id to be used on the entry
	client.add_param(kparams, 'conversionProfileId', conversion_profile_id);
	client.queue_service_action_call('baseentry', 'updateContent', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#update_thumbnail_from_source_entry(entry_id, source_entry_id, time_offset) ⇒ Object

Update entry thumbnail from a different entry by a specified time offset (in seconds).



9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
# File 'lib/kaltura_client.rb', line 9416

def update_thumbnail_from_source_entry(entry_id, source_entry_id, time_offset)
	kparams = {}
	# Media entry id
	client.add_param(kparams, 'entryId', entry_id);
	# Media entry id
	client.add_param(kparams, 'sourceEntryId', source_entry_id);
	# Time offset (in seconds)
	client.add_param(kparams, 'timeOffset', time_offset);
	client.queue_service_action_call('baseentry', 'updateThumbnailFromSourceEntry', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#update_thumbnail_from_url(entry_id, url) ⇒ Object

Update entry thumbnail using url.



9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
# File 'lib/kaltura_client.rb', line 9401

def update_thumbnail_from_url(entry_id, url)
	kparams = {}
	# Media entry id
	client.add_param(kparams, 'entryId', entry_id);
	# file url
	client.add_param(kparams, 'url', url);
	client.queue_service_action_call('baseentry', 'updateThumbnailFromUrl', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#update_thumbnail_jpeg(entry_id, file_data) ⇒ Object

Update entry thumbnail using a raw jpeg file.



9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
# File 'lib/kaltura_client.rb', line 9386

def update_thumbnail_jpeg(entry_id, file_data)
	kparams = {}
	# Media entry id
	client.add_param(kparams, 'entryId', entry_id);
	# Jpeg file data
	client.add_param(kparams, 'fileData', file_data);
	client.queue_service_action_call('baseentry', 'updateThumbnailJpeg', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#upload(file_data) ⇒ Object

Upload a file to Kaltura, that can be used to create an entry.



9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
# File 'lib/kaltura_client.rb', line 9373

def upload(file_data)
	kparams = {}
	# The file data
	client.add_param(kparams, 'fileData', file_data);
	client.queue_service_action_call('baseentry', 'upload', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end