Class: Kaltura::KalturaUploadTokenService

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

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaUploadTokenService

Returns a new instance of KalturaUploadTokenService.



13581
13582
13583
# File 'lib/kaltura_client.rb', line 13581

def initialize(client)
	super(client)
end

Instance Method Details

#add(upload_token = KalturaNotImplemented) ⇒ Object

Adds new upload token to upload a file



13587
13588
13589
13590
13591
13592
13593
13594
13595
# File 'lib/kaltura_client.rb', line 13587

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

#delete(upload_token_id) ⇒ Object

Deletes the upload token by upload token id



13627
13628
13629
13630
13631
13632
13633
13634
13635
# File 'lib/kaltura_client.rb', line 13627

def delete(upload_token_id)
	kparams = {}
	client.add_param(kparams, 'uploadTokenId', upload_token_id);
	client.queue_service_action_call('uploadtoken', 'delete', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#get(upload_token_id) ⇒ Object

Get upload token by id



13599
13600
13601
13602
13603
13604
13605
13606
13607
# File 'lib/kaltura_client.rb', line 13599

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

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

List upload token by filter with pager support. When using a user session the service will be restricted to users objects only.



13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
# File 'lib/kaltura_client.rb', line 13640

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

#upload(upload_token_id, file_data, resume = false, final_chunk = true, resume_at = -1)) ⇒ Object

Upload a file using the upload token id, returns an error on failure (an exception will be thrown when using one of the Kaltura clients)



13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
# File 'lib/kaltura_client.rb', line 13611

def upload(upload_token_id, file_data, resume=false, final_chunk=true, resume_at=-1)
	kparams = {}
	client.add_param(kparams, 'uploadTokenId', upload_token_id);
	client.add_param(kparams, 'fileData', file_data);
	client.add_param(kparams, 'resume', resume);
	client.add_param(kparams, 'finalChunk', final_chunk);
	client.add_param(kparams, 'resumeAt', resume_at);
	client.queue_service_action_call('uploadtoken', 'upload', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end