Class: Kaltura::KalturaUploadTokenService
- Inherits:
-
KalturaServiceBase
- Object
- KalturaServiceBase
- Kaltura::KalturaUploadTokenService
- Defined in:
- lib/kaltura_client.rb
Instance Attribute Summary
Attributes inherited from KalturaServiceBase
Instance Method Summary collapse
-
#add(upload_token = KalturaNotImplemented) ⇒ Object
Adds new upload token to upload a file.
-
#delete(upload_token_id) ⇒ Object
Deletes the upload token by upload token id.
-
#get(upload_token_id) ⇒ Object
Get upload token by id.
-
#initialize(client) ⇒ KalturaUploadTokenService
constructor
A new instance of KalturaUploadTokenService.
-
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object
List upload token by filter with pager support.
-
#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).
Constructor Details
#initialize(client) ⇒ KalturaUploadTokenService
Returns a new instance of KalturaUploadTokenService.
4971 4972 4973 |
# File 'lib/kaltura_client.rb', line 4971 def initialize(client) super(client) end |
Instance Method Details
#add(upload_token = KalturaNotImplemented) ⇒ Object
Adds new upload token to upload a file
4977 4978 4979 4980 4981 4982 4983 4984 4985 |
# File 'lib/kaltura_client.rb', line 4977 def add(upload_token=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'uploadToken', upload_token) client.queue_service_action_call('uploadtoken', 'add', 'KalturaUploadToken', 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
5018 5019 5020 5021 5022 5023 5024 5025 5026 |
# File 'lib/kaltura_client.rb', line 5018 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
4989 4990 4991 4992 4993 4994 4995 4996 4997 |
# File 'lib/kaltura_client.rb', line 4989 def get(upload_token_id) kparams = {} client.add_param(kparams, 'uploadTokenId', upload_token_id) client.queue_service_action_call('uploadtoken', 'get', 'KalturaUploadToken', 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.
5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 |
# File 'lib/kaltura_client.rb', line 5031 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', 'KalturaUploadTokenListResponse', 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)
5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 |
# File 'lib/kaltura_client.rb', line 5001 def upload(upload_token_id, file_data, resume=false, final_chunk=true, resume_at=-1) kparams = {} kfiles = {} client.add_param(kparams, 'uploadTokenId', upload_token_id) client.add_param(kfiles, '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', 'KalturaUploadToken', kparams, kfiles) if (client.is_multirequest) return nil end return client.do_queue() end |