goncalossilva_kaltura-ruby 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/.gitignore +7 -0
- data/LICENSE +661 -0
- data/README.markdown +56 -0
- data/README.rdoc +54 -0
- data/Rakefile +61 -0
- data/VERSION +1 -0
- data/VERSION.yml +5 -0
- data/goncalossilva_kaltura-ruby.gemspec +179 -0
- data/lib/kaltura.rb +19 -0
- data/lib/kaltura/constants.rb +77 -0
- data/lib/kaltura/constants/access_control_order_by.rb +14 -0
- data/lib/kaltura/constants/audio_codec.rb +16 -0
- data/lib/kaltura/constants/base.rb +61 -0
- data/lib/kaltura/constants/batch_job.rb +87 -0
- data/lib/kaltura/constants/bit_rate_mode.rb +14 -0
- data/lib/kaltura/constants/category_order_by.rb +18 -0
- data/lib/kaltura/constants/commercial_use_type.rb +14 -0
- data/lib/kaltura/constants/container_format.rb +21 -0
- data/lib/kaltura/constants/control_panel_command.rb +49 -0
- data/lib/kaltura/constants/conversion_profile_order_by.rb +14 -0
- data/lib/kaltura/constants/country_restriction_type.rb +16 -0
- data/lib/kaltura/constants/data_entry_order_by.rb +20 -0
- data/lib/kaltura/constants/directory_restriction_type.rb +14 -0
- data/lib/kaltura/constants/document.rb +39 -0
- data/lib/kaltura/constants/duration_type.rb +16 -0
- data/lib/kaltura/constants/editor_type.rb +14 -0
- data/lib/kaltura/constants/email_ingestion_profile_status.rb +14 -0
- data/lib/kaltura/constants/entry.rb +59 -0
- data/lib/kaltura/constants/file_sync.rb +67 -0
- data/lib/kaltura/constants/flavor_asset_status.rb +18 -0
- data/lib/kaltura/constants/gender.rb +15 -0
- data/lib/kaltura/constants/google_syndication_feed.rb +39 -0
- data/lib/kaltura/constants/i_tunes_syndication_feed.rb +42 -0
- data/lib/kaltura/constants/i_tunes_syndication_feed/categories.rb +82 -0
- data/lib/kaltura/constants/license_type.rb +29 -0
- data/lib/kaltura/constants/live_stream_admin_entry_order_by.rb +31 -0
- data/lib/kaltura/constants/mail_job_order_by.rb +16 -0
- data/lib/kaltura/constants/media.rb +55 -0
- data/lib/kaltura/constants/mix_entry_order_by.rb +28 -0
- data/lib/kaltura/constants/moderation.rb +34 -0
- data/lib/kaltura/constants/notification.rb +43 -0
- data/lib/kaltura/constants/nullable_boolean.rb +14 -0
- data/lib/kaltura/constants/partner.rb +64 -0
- data/lib/kaltura/constants/playable_entry_order_by.rb +28 -0
- data/lib/kaltura/constants/playlist.rb +35 -0
- data/lib/kaltura/constants/report_type.rb +24 -0
- data/lib/kaltura/constants/search_provider_type.rb +29 -0
- data/lib/kaltura/constants/session_type.rb +14 -0
- data/lib/kaltura/constants/site_restriction_type.rb +14 -0
- data/lib/kaltura/constants/source_type.rb +17 -0
- data/lib/kaltura/constants/stats.rb +49 -0
- data/lib/kaltura/constants/stats/kmc_event_type.rb +77 -0
- data/lib/kaltura/constants/syndication_feed.rb +37 -0
- data/lib/kaltura/constants/system_user.rb +17 -0
- data/lib/kaltura/constants/tube_mogul_syndication_feed.rb +34 -0
- data/lib/kaltura/constants/ui_conf.rb +26 -0
- data/lib/kaltura/constants/upload_error_code.rb +9 -0
- data/lib/kaltura/constants/user.rb +16 -0
- data/lib/kaltura/constants/video_codec.rb +16 -0
- data/lib/kaltura/constants/widget.rb +15 -0
- data/lib/kaltura/constants/yahoo_syndication_feed.rb +44 -0
- data/lib/kaltura/filter.rb +75 -0
- data/lib/kaltura/filter/access_control_filter.rb +20 -0
- data/lib/kaltura/filter/base_entry_filter.rb +115 -0
- data/lib/kaltura/filter/base_filter.rb +7 -0
- data/lib/kaltura/filter/base_job_filter.rb +28 -0
- data/lib/kaltura/filter/batch_job_filter.rb +54 -0
- data/lib/kaltura/filter/category_filter.rb +23 -0
- data/lib/kaltura/filter/control_panel_command_filter.rb +39 -0
- data/lib/kaltura/filter/conversion_profile_filter.rb +12 -0
- data/lib/kaltura/filter/document_entry_filter.rb +12 -0
- data/lib/kaltura/filter/file_sync_filter.rb +93 -0
- data/lib/kaltura/filter/flavor_params_filter.rb +11 -0
- data/lib/kaltura/filter/flavor_params_output_filter.rb +14 -0
- data/lib/kaltura/filter/media_entry_filter.rb +22 -0
- data/lib/kaltura/filter/media_entry_filter_for_playlist.rb +11 -0
- data/lib/kaltura/filter/partner_filter.rb +22 -0
- data/lib/kaltura/filter/playable_entry_filter.rb +40 -0
- data/lib/kaltura/filter/report_input_filter.rb +25 -0
- data/lib/kaltura/filter/system_partner_usage_filter.rb +15 -0
- data/lib/kaltura/filter/ui_conf_filter.rb +40 -0
- data/lib/kaltura/filter/user_filter.rb +27 -0
- data/lib/kaltura/filter/widget_filter.rb +37 -0
- data/lib/kaltura/kaltura_client.rb +1762 -0
- data/lib/kaltura/kaltura_client_base.rb +300 -0
- data/lib/kaltura/response.rb +112 -0
- data/lib/kaltura/service.rb +142 -0
- data/lib/kaltura/service/access_control_service.rb +110 -0
- data/lib/kaltura/service/admin_user_service.rb +69 -0
- data/lib/kaltura/service/base_entry_service.rb +331 -0
- data/lib/kaltura/service/base_service.rb +42 -0
- data/lib/kaltura/service/bulk_upload_service.rb +75 -0
- data/lib/kaltura/service/category_service.rb +112 -0
- data/lib/kaltura/service/conversion_profile_service.rb +116 -0
- data/lib/kaltura/service/data_service.rb +116 -0
- data/lib/kaltura/service/email_ingestion_profile_service.rb +122 -0
- data/lib/kaltura/service/flavor_asset_service.rb +155 -0
- data/lib/kaltura/service/flavor_params_service.rb +111 -0
- data/lib/kaltura/service/live_stream_service.rb +140 -0
- data/lib/kaltura/service/media_service.rb +546 -0
- data/lib/kaltura/service/mixing_service.rb +86 -0
- data/lib/kaltura/service/notification_service.rb +13 -0
- data/lib/kaltura/service/partner_service.rb +41 -0
- data/lib/kaltura/service/playlist_service.rb +73 -0
- data/lib/kaltura/service/report_service.rb +47 -0
- data/lib/kaltura/service/search_service.rb +34 -0
- data/lib/kaltura/service/session_service.rb +24 -0
- data/lib/kaltura/service/stats_service.rb +24 -0
- data/lib/kaltura/service/syndication_feed_service.rb +50 -0
- data/lib/kaltura/service/system_partner_service.rb +58 -0
- data/lib/kaltura/service/system_service.rb +11 -0
- data/lib/kaltura/service/system_user_service.rb +63 -0
- data/lib/kaltura/service/ui_conf_service.rb +51 -0
- data/lib/kaltura/service/upload_service.rb +18 -0
- data/lib/kaltura/service/user_service.rb +44 -0
- data/lib/kaltura/service/widget_service.rb +38 -0
- data/lib/kaltura/service/x_internal_service.rb +13 -0
- data/test/kaltura-ruby_test.rb +7 -0
- data/test/test.rb +23 -0
- data/test/test_2.rb +26 -0
- data/test/test_error.rb +14 -0
- data/test/test_helper.rb +10 -0
- metadata +222 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
module Kaltura
|
|
2
|
+
module Service
|
|
3
|
+
##
|
|
4
|
+
# AccessControlService is responsible for adding and managing access control profiles.
|
|
5
|
+
#
|
|
6
|
+
# @example Add a new access control profile:
|
|
7
|
+
# access_control = Kaltura::AccessControl.new
|
|
8
|
+
# access_control.name = "Restrictions"
|
|
9
|
+
# client.access_control_service.add(access_control)
|
|
10
|
+
#
|
|
11
|
+
# @example Retrive an access control profile:
|
|
12
|
+
# client.access_control_service.get(5)
|
|
13
|
+
#
|
|
14
|
+
# @example Update an existing access control profile:
|
|
15
|
+
# new_access_control = Kaltura::AccessControl.new
|
|
16
|
+
# new_access_control.description = "making the world safer one profile at a time."
|
|
17
|
+
# client.access_control_service.update(5,new_access_control)
|
|
18
|
+
#
|
|
19
|
+
# @example Delete an eisting access control profile:
|
|
20
|
+
# client.access_control_service.delete(5)
|
|
21
|
+
#
|
|
22
|
+
# @example List up to 10 Access Control Profiles ordered by name:
|
|
23
|
+
# filter = Kaltura::Filter::AccessControlFilter.new
|
|
24
|
+
# filter.order_by('name')
|
|
25
|
+
# pager = Kaltura::FilterPager.new
|
|
26
|
+
# pager.page_size = 10
|
|
27
|
+
# client.access_control_service.list(filter,pager)
|
|
28
|
+
##
|
|
29
|
+
class AccessControlService < BaseService
|
|
30
|
+
|
|
31
|
+
##
|
|
32
|
+
# Adds a new Access Control Profile.
|
|
33
|
+
#
|
|
34
|
+
# @param [Kaltura::AccessControl] access_control The new profile to add.
|
|
35
|
+
#
|
|
36
|
+
# @return [Kaltura::AccessControl] Returns the AccessControl object if the action was successful. Useful for knowing the id of the object.
|
|
37
|
+
#
|
|
38
|
+
# @raise [Kaltura::APIError] default Kaltura error messages.
|
|
39
|
+
##
|
|
40
|
+
def add(access_control)
|
|
41
|
+
kparams = {}
|
|
42
|
+
client.add_param(kparams, 'accessControl', access_control)
|
|
43
|
+
perform_request('accessControl','add',kparams,false)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
##
|
|
47
|
+
# Retrieves an Access Control Profile by ID.
|
|
48
|
+
#
|
|
49
|
+
# @param [Integer] id The Access Control Profile ID.
|
|
50
|
+
#
|
|
51
|
+
# @return [Kaltura::AccessControl] Returns the AccessControl object if the action was successful.
|
|
52
|
+
#
|
|
53
|
+
# @raise [Kaltura::APIError] default Kaltura error messages.
|
|
54
|
+
##
|
|
55
|
+
def get(id)
|
|
56
|
+
kparams = {}
|
|
57
|
+
client.add_param(kparams, 'id', id)
|
|
58
|
+
perform_request('accessControl','get',kparams,false)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
##
|
|
62
|
+
# Updates an Access Control Profile by ID. Like other API update service calls, you instantiate a new AccessControl object,
|
|
63
|
+
# perform your changes to the new object, and use that as the second parameter. There are no required parameters.
|
|
64
|
+
#
|
|
65
|
+
# @param [Integer] id The Access Control Profile ID.
|
|
66
|
+
# @param [Kaltura::AccessControl] access_control A newly instantiated AccessControl object that has the only the attributes you want to edit.
|
|
67
|
+
#
|
|
68
|
+
# @return [Kaltura:AccessControl] Returns the updated Access Control profile if the action was successful.
|
|
69
|
+
#
|
|
70
|
+
# @raise [Kaltura::APIError] default Kaltura error messages.
|
|
71
|
+
##
|
|
72
|
+
def update(id, access_control)
|
|
73
|
+
kparams = {}
|
|
74
|
+
client.add_param(kparams, 'id', id)
|
|
75
|
+
client.add_param(kparams, 'accessControl', access_control)
|
|
76
|
+
perform_request('accessControl','update',kparams,false)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
##
|
|
80
|
+
# Deletes an Access Control Profile by ID.
|
|
81
|
+
#
|
|
82
|
+
# @param [Integer] id The Access Control Profile ID.
|
|
83
|
+
#
|
|
84
|
+
# @return [nil] returns nothing
|
|
85
|
+
#
|
|
86
|
+
# @raise [Kaltura::APIError] default Kaltura error messages.
|
|
87
|
+
##
|
|
88
|
+
def delete(id)
|
|
89
|
+
kparams = {}
|
|
90
|
+
client.add_param(kparams, 'id', id)
|
|
91
|
+
perform_request('accessControl','delete',kparams,false)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
##
|
|
95
|
+
# Lists Access Control Profiles given an optional filter and pager.
|
|
96
|
+
#
|
|
97
|
+
# @param [Kaltura::Filter::AccessControlFilter] filter
|
|
98
|
+
# @param [Kaltura::FilterPager] pager
|
|
99
|
+
#
|
|
100
|
+
# @return [Kaltura::Response::AccessControlListResponse] Returns an equivalent response to Kaltura::BaseResponse.
|
|
101
|
+
##
|
|
102
|
+
def list(filter=nil, pager=nil)
|
|
103
|
+
kparams = {}
|
|
104
|
+
client.add_param(kparams, 'filter', filter)
|
|
105
|
+
client.add_param(kparams, 'pager', pager)
|
|
106
|
+
perform_request('accessControl','list',kparams,false)
|
|
107
|
+
end
|
|
108
|
+
end #class AccessControlService
|
|
109
|
+
end
|
|
110
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
module Kaltura
|
|
2
|
+
module Service
|
|
3
|
+
##
|
|
4
|
+
# AdminUserService manages details for the administrative KMC user.
|
|
5
|
+
#
|
|
6
|
+
# @example Setting a new Admin password:
|
|
7
|
+
# client.admin_user_service.update_password('pat@velir.com','OMGWTFPASSWRD',,'PASSWRDBBQ')
|
|
8
|
+
# @example Setting a new Admin password/email:
|
|
9
|
+
# client.admin_user_service.update_password('pat@velir.com','OMGWTFPASSWRD','patrick@velir.com','PASSWRDBBQ')
|
|
10
|
+
# @example Resetting a admins password:
|
|
11
|
+
# client.admin_user_service.reset_password('pat@velir.com')
|
|
12
|
+
##
|
|
13
|
+
class AdminUserService < BaseService
|
|
14
|
+
|
|
15
|
+
##
|
|
16
|
+
# Updates the admin password and email.
|
|
17
|
+
#
|
|
18
|
+
# @param [String] email Administrative user email.
|
|
19
|
+
# @param [String] password Current administrative user password.
|
|
20
|
+
# @param [String] new_email
|
|
21
|
+
#
|
|
22
|
+
# @return [Kaltura::AdminUser] The administrative user updated.
|
|
23
|
+
#
|
|
24
|
+
# @raise [Kaltura::APIError] Returns two additional error messages: INVALID_FIELD_VALUE when a field isn't valid
|
|
25
|
+
# and ADMIN_KUSER_WRONG_OLD_PASSWORD when the old password is wrong.
|
|
26
|
+
##
|
|
27
|
+
def update_password(email, password, new_email='', new_password='')
|
|
28
|
+
kparams = {}
|
|
29
|
+
client.add_param(kparams, 'email', email)
|
|
30
|
+
client.add_param(kparams, 'password', password)
|
|
31
|
+
client.add_param(kparams, 'newEmail', new_email)
|
|
32
|
+
client.add_param(kparams, 'newPassword', new_password)
|
|
33
|
+
perform_request('adminUser','updatePassword',kparams,false)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
##
|
|
37
|
+
# Resets admins user password and sends the new one to the admins' email address.
|
|
38
|
+
#
|
|
39
|
+
# @param [String] email The admin's email address.
|
|
40
|
+
#
|
|
41
|
+
# @return [nil] returns nil.
|
|
42
|
+
#
|
|
43
|
+
# @raise [Kaltura::APIError] raises default Kaltura errors.
|
|
44
|
+
##
|
|
45
|
+
def reset_password(email)
|
|
46
|
+
kparams = {}
|
|
47
|
+
client.add_param(kparams, 'email', email)
|
|
48
|
+
perform_request('adminUser','resetPassword',kparams,false)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
##
|
|
52
|
+
# Gets an admin session using the admin email and password. This method is used for the KMC login.
|
|
53
|
+
#
|
|
54
|
+
# @param [String] email The admin's email address.
|
|
55
|
+
# @param [String] password The admin's password.
|
|
56
|
+
#
|
|
57
|
+
# @return [String] User session string.
|
|
58
|
+
#
|
|
59
|
+
# @raise [Kaltura::APIError] raises default Kaltura errors in addition to ADMIN_KUSER_NOT_FOUND if the user isn't found.
|
|
60
|
+
##
|
|
61
|
+
def login(email, password)
|
|
62
|
+
kparams = {}
|
|
63
|
+
client.add_param(kparams, 'email', email)
|
|
64
|
+
client.add_param(kparams, 'password', password)
|
|
65
|
+
perform_request('adminUser','login',kparams,false)
|
|
66
|
+
end
|
|
67
|
+
end #class AdminUserService
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
module Kaltura
|
|
2
|
+
module Service
|
|
3
|
+
##
|
|
4
|
+
# BaseEntryService is a service for generic entries. If you do not know what type of media you are working with,
|
|
5
|
+
# this is a good service to use. You need to know what media type you are working with for MediaService.
|
|
6
|
+
#
|
|
7
|
+
# @example Retrieve a base entry:
|
|
8
|
+
# client.base_entry_service.get('1_qua324a')
|
|
9
|
+
#
|
|
10
|
+
# @example Upload a new entry:
|
|
11
|
+
# upload_file = File.open("/path/to/media_file")
|
|
12
|
+
# upload_token = client.base_entry_service.upload(upload_file)
|
|
13
|
+
# base_entry = Kaltura::BaseEntry.new
|
|
14
|
+
# base_entry.name = "WAFFLES ARE MY FRIEND"
|
|
15
|
+
# client.base_entry_service.add_from_uploaded_file(base_entry,upload_token)
|
|
16
|
+
#
|
|
17
|
+
# @example Update an existing entry:
|
|
18
|
+
# update_entry = Kaltura::BaseEntry.new
|
|
19
|
+
# update_entry.description = "Pancakes are lame yo."
|
|
20
|
+
# client.base_entry_service.update('1_qua324a',update_entry)
|
|
21
|
+
#
|
|
22
|
+
# @example Delete an existing entry:
|
|
23
|
+
# client.base_entry_service.delete('1_qua324a')
|
|
24
|
+
#
|
|
25
|
+
# @example Update an Entry thumbnail via file upload:
|
|
26
|
+
# thumbnail_file = File.open('/path/to/thumbnail_file')
|
|
27
|
+
# client.base_entry_service.update_thumbnail_from_jpeg('1_qua324a',thumbnail_file)
|
|
28
|
+
#
|
|
29
|
+
# @example Update an entry thumbnail from a url:
|
|
30
|
+
# client.base_entry_service.update_thumbnail_from_url('1_qua324a','http://twitter.com/waffles/waffletastic.jpg')
|
|
31
|
+
#
|
|
32
|
+
# @example Update an entry thumbnail from another entry:
|
|
33
|
+
# client.base_entry_service.update_thumbnail_from_source_entry('1_qua324a','0_k24aj1b',5)
|
|
34
|
+
##
|
|
35
|
+
class BaseEntryService < BaseService
|
|
36
|
+
|
|
37
|
+
##
|
|
38
|
+
# Generic add entry using an uploaded file, should be used when the uploaded entry type is not known.
|
|
39
|
+
#
|
|
40
|
+
# @param [Kaltura::BaseEntry] entry A newly instantiated BaseEntry object filled in with appropriate fields.
|
|
41
|
+
# @param [String] upload_token_id The upload token from the upload() method.
|
|
42
|
+
# @param [Kaltura::Constants::Entry::Type] type The type of entry. This should be defaulted. Otherwise use the MediaService.
|
|
43
|
+
#
|
|
44
|
+
# @return [Kaltura::BaseEntry] Returns a Kaltura Entry. This is helpful to retrieve the entry_id.
|
|
45
|
+
#
|
|
46
|
+
# @raise [Kaltura::APIError] Default Kaltura errors.
|
|
47
|
+
##
|
|
48
|
+
def add_from_uploaded_file(entry, upload_token_id, type=-1)
|
|
49
|
+
kparams = {}
|
|
50
|
+
client.add_param(kparams, 'entry', entry)
|
|
51
|
+
client.add_param(kparams, 'uploadTokenId', upload_token_id)
|
|
52
|
+
client.add_param(kparams, 'type', type)
|
|
53
|
+
perform_request('baseEntry','addFromUploadedFile',kparams,false)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
##
|
|
57
|
+
# Gets a base entry by ID.
|
|
58
|
+
#
|
|
59
|
+
# @param [String] entry_id Kaltura entry.
|
|
60
|
+
# @param [Integer] version Version of the entry.
|
|
61
|
+
#
|
|
62
|
+
# @return [Kaltura::BaseEntry] The requested Entry.
|
|
63
|
+
#
|
|
64
|
+
# @raise [Kaltura::APIError] Default Kaltura errors.
|
|
65
|
+
##
|
|
66
|
+
def get(entry_id, version=-1)
|
|
67
|
+
kparams = {}
|
|
68
|
+
client.add_param(kparams, 'entryId', entry_id)
|
|
69
|
+
client.add_param(kparams, 'version', version)
|
|
70
|
+
perform_request('baseEntry','get',kparams,false)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
##
|
|
74
|
+
# Updates a base entry. It is best to instantiate a new base entry for the second parameter and initilize
|
|
75
|
+
# those fields for the changes you want to change instead of using an existing entry object.
|
|
76
|
+
#
|
|
77
|
+
# @param [String] entry_id The Kaltura entry to be updated.
|
|
78
|
+
# @param [Kaltura::BaseEntry] base_entry A BaseEntry object with fields populated that you wish to change.
|
|
79
|
+
#
|
|
80
|
+
# @return [Kaltura::BaseEntry] Returns the Entry defined by entry_id with the updated fields.
|
|
81
|
+
#
|
|
82
|
+
# @raise [Kaltura::APIError] raises "ENTRY_ID_NOT_FOUND" if the entry_id isn't found in addition to default errors.
|
|
83
|
+
##
|
|
84
|
+
def update(entry_id, base_entry)
|
|
85
|
+
kparams = {}
|
|
86
|
+
client.add_param(kparams, 'entryId', entry_id)
|
|
87
|
+
client.add_param(kparams, 'baseEntry', base_entry)
|
|
88
|
+
perform_request('baseEntry','update',kparams,false)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
##
|
|
92
|
+
# Retrieves an array of BaseEntries when provided a comma seperated list of entry_id's.
|
|
93
|
+
#
|
|
94
|
+
# @param [String] entry_ids A comma delimited list of Kaltura entry_id's.
|
|
95
|
+
#
|
|
96
|
+
# @return [Array] Returns an array of Entries, based upon their format.
|
|
97
|
+
#
|
|
98
|
+
# @raise [Kaltura::APIError] Default Kaltura errors.
|
|
99
|
+
##
|
|
100
|
+
def get_by_ids(entry_ids)
|
|
101
|
+
kparams = {}
|
|
102
|
+
client.add_param(kparams, 'entryIds', entry_ids)
|
|
103
|
+
perform_request('baseEntry','getByIds',kparams,false)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
##
|
|
107
|
+
# Deletes the specified Kaltura Entry.
|
|
108
|
+
#
|
|
109
|
+
# @param [String] entry_id The Kaltura entry to be deleted.
|
|
110
|
+
#
|
|
111
|
+
# @return [nil] Returns nothing.
|
|
112
|
+
#
|
|
113
|
+
# @raise [Kaltura::APIError] Default Kaltura errors.
|
|
114
|
+
##
|
|
115
|
+
def delete(entry_id)
|
|
116
|
+
kparams = {}
|
|
117
|
+
client.add_param(kparams, 'entryId', entry_id)
|
|
118
|
+
perform_request('baseEntry','delete',kparams,false)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
##
|
|
122
|
+
# Lists base entries by the filter with paging support.
|
|
123
|
+
#
|
|
124
|
+
# @param [Kaltura::Filter::BaseEntryFilter] filter
|
|
125
|
+
# @param [Kaltura::FilterPager] pager
|
|
126
|
+
#
|
|
127
|
+
# @return [Kaltura::Response::BaseEntryListResponse] wrapper for Kaltura::Response::BaseResponse.
|
|
128
|
+
#
|
|
129
|
+
# @raise [Kaltura::APIError] Default Kaltura errors.
|
|
130
|
+
##
|
|
131
|
+
def list(filter=nil, pager=nil)
|
|
132
|
+
kparams = {}
|
|
133
|
+
client.add_param(kparams, 'filter', filter)
|
|
134
|
+
client.add_param(kparams, 'pager', pager)
|
|
135
|
+
perform_request('baseEntry','list',kparams,false)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
##
|
|
139
|
+
# Returns a count based on a specified base entry filter.
|
|
140
|
+
#
|
|
141
|
+
# @param [Kaltura::Filter::BaseEntryFilter] filter
|
|
142
|
+
#
|
|
143
|
+
# @return [Integer] Number of base entries within the filter.
|
|
144
|
+
#
|
|
145
|
+
# @raise [Kaltura::APIError] Default Kaltura errors.
|
|
146
|
+
##
|
|
147
|
+
def count(filter=nil)
|
|
148
|
+
kparams = {}
|
|
149
|
+
client.add_param(kparams, 'filter', filter)
|
|
150
|
+
perform_request('baseEntry','count',kparams,false)
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
##
|
|
154
|
+
# Uploads a file to the Kaltura server and returns a token to be used to create a Kaltura entry.
|
|
155
|
+
#
|
|
156
|
+
# @param [File] file_data The file to upload to Kaltura.
|
|
157
|
+
#
|
|
158
|
+
# @return [String] The file upload_token_id to be used by entry adding methods.
|
|
159
|
+
#
|
|
160
|
+
# @raise [Kaltura::APIError] Default Kaltura errors.
|
|
161
|
+
##
|
|
162
|
+
def upload(file_data)
|
|
163
|
+
kparams = {}
|
|
164
|
+
client.add_param(kparams, 'fileData', file_data)
|
|
165
|
+
perform_request('baseEntry','upload',kparams,false)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
##
|
|
169
|
+
# Updates an entries thumbnail using a raw jpeg file.
|
|
170
|
+
#
|
|
171
|
+
# @param [String] entry_id The Kaltura entry.
|
|
172
|
+
# @param [File] file_data The MIME type of 'image/jpg' file to be used as the entries thumbnail.
|
|
173
|
+
# This will update the entries version and the thumbnail's version.
|
|
174
|
+
#
|
|
175
|
+
# @return [Kaltura::BaseEntry] The updated Kaltura entry. The primary change will be a version bump.
|
|
176
|
+
#
|
|
177
|
+
# @raise [Kaltura::APIError] Will raise 'PERMISSION_DENIED_TO_UPDATE_ENTRY'
|
|
178
|
+
# if the user session doesn't have permissions to edit this particular entry.
|
|
179
|
+
##
|
|
180
|
+
def update_thumbnail_jpeg(entry_id, file_data)
|
|
181
|
+
kparams = {}
|
|
182
|
+
client.add_param(kparams, 'entryId', entry_id)
|
|
183
|
+
client.add_param(kparams, 'fileData', file_data)
|
|
184
|
+
perform_request('baseEntry','updateThumbnailJpeg',kparams,false)
|
|
185
|
+
end
|
|
186
|
+
##
|
|
187
|
+
# Updates an entries thumbnail using a valid URL.
|
|
188
|
+
#
|
|
189
|
+
# @param [String] entry_id The Kaltura entry.
|
|
190
|
+
# @param [File] url The URL to pull the thumbnail from.
|
|
191
|
+
# This will update the entries version and the thumbnail's version.
|
|
192
|
+
#
|
|
193
|
+
# @return [Kaltura::BaseEntry] The updated Kaltura entry. The primary change will be a version bump.
|
|
194
|
+
#
|
|
195
|
+
# @raise [Kaltura::APIError] Will raise 'PERMISSION_DENIED_TO_UPDATE_ENTRY'
|
|
196
|
+
# if the user session doesn't have permissions to edit this particular entry.
|
|
197
|
+
##
|
|
198
|
+
def update_thumbnail_from_url(entry_id, url)
|
|
199
|
+
kparams = {}
|
|
200
|
+
client.add_param(kparams, 'entryId', entry_id)
|
|
201
|
+
client.add_param(kparams, 'url', url)
|
|
202
|
+
perform_request('baseEntry','updateThumbnailFromUrl',kparams,false)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
##
|
|
206
|
+
# Updates the entries thumbnail from another entry given a specified time offset.
|
|
207
|
+
# This is one truly odd API call.
|
|
208
|
+
#
|
|
209
|
+
# @param [String] entry_id The Kaltura entry to be changed.
|
|
210
|
+
# @param [String] source_entry_id The Kaltura entry providing the change.
|
|
211
|
+
# @param [Integer] time_offset The time in seconds to offset the source_entry_id thumbnail by.
|
|
212
|
+
#
|
|
213
|
+
# @return [Kaltura::BaseEntry] The updated Kaltura entry. The primary change will be a version bump.
|
|
214
|
+
#
|
|
215
|
+
# @raise [Kaltura::APIError] Will raise 'PERMISSION_DENIED_TO_UPDATE_ENTRY'
|
|
216
|
+
# if the user session doesn't have permissions to edit this particular entry.
|
|
217
|
+
##
|
|
218
|
+
def update_thumbnail_from_source_entry(entry_id, source_entry_id, time_offset)
|
|
219
|
+
kparams = {}
|
|
220
|
+
client.add_param(kparams, 'entryId', entry_id)
|
|
221
|
+
client.add_param(kparams, 'sourceEntryId', source_entry_id)
|
|
222
|
+
client.add_param(kparams, 'timeOffset', time_offset)
|
|
223
|
+
perform_request('baseEntry','updateThumbnailFromSourceEntry',kparams,false)
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
##
|
|
227
|
+
# Flags an inappropriate Kaltura entry for moderation.
|
|
228
|
+
# The entry ID is provided in the moderation_flag, so it isn't blatently obvious which entry you are
|
|
229
|
+
# interacting with. The method also outputs nothing, so success/failure is more difficult than necessary
|
|
230
|
+
# to track.
|
|
231
|
+
#
|
|
232
|
+
# @param [Kaltura::ModerationFlag] moderation_flag The Kaltura Entry being flagged is hidden down in the field 'flagged_entry_id'.
|
|
233
|
+
#
|
|
234
|
+
# @return [nil] Returns nothing.
|
|
235
|
+
#
|
|
236
|
+
# @raise [Kaltura::APIError] raises "ENTRY_ID_NOT_FOUND" if the entry_id isn't found in addition to default errors.
|
|
237
|
+
##
|
|
238
|
+
def flag(moderation_flag)
|
|
239
|
+
kparams = {}
|
|
240
|
+
client.add_param(kparams, 'moderationFlag', moderation_flag)
|
|
241
|
+
perform_request('baseEntry','flag',kparams,false)
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
##
|
|
245
|
+
# Rejects a Kaltura entry and marks any pending flags as moderated.
|
|
246
|
+
# This makes the entry unplayable and is a much more sane method to flag content than the flag method.
|
|
247
|
+
#
|
|
248
|
+
# @param [String] entry_id The Kaltura entry to reject.
|
|
249
|
+
#
|
|
250
|
+
# @return [nil] Returns nothing.
|
|
251
|
+
#
|
|
252
|
+
# @raise [Kaltura::APIError] raises "ENTRY_ID_NOT_FOUND" if the entry_id isn't found in addition to default errors.
|
|
253
|
+
##
|
|
254
|
+
def reject(entry_id)
|
|
255
|
+
kparams = {}
|
|
256
|
+
client.add_param(kparams, 'entryId', entry_id)
|
|
257
|
+
perform_request('baseEntry','reject',kparams,false)
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
##
|
|
261
|
+
# Approves an entry and marks any pending flags as moderated.
|
|
262
|
+
# This makes the entry playable.
|
|
263
|
+
#
|
|
264
|
+
# @param [String] entry_id The Kaltura entry to approve.
|
|
265
|
+
#
|
|
266
|
+
# @return [nil] Returns nothing.
|
|
267
|
+
#
|
|
268
|
+
# @raise [Kaltura::APIError] raises "ENTRY_ID_NOT_FOUND" if the entry_id isn't found in addition to default errors.
|
|
269
|
+
##
|
|
270
|
+
def approve(entry_id)
|
|
271
|
+
kparams = {}
|
|
272
|
+
client.add_param(kparams, 'entryId', entry_id)
|
|
273
|
+
perform_request('baseEntry','approve',kparams,false)
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
##
|
|
277
|
+
# Lists all pending moderation flags for the specified entry.
|
|
278
|
+
#
|
|
279
|
+
# @param [String] entry_id The Kaltura entry.
|
|
280
|
+
# @param [Kaltura::FilterPager] pager An optional pager to use for a large list of pending moderation flags.
|
|
281
|
+
#
|
|
282
|
+
# @return [Kaltura::Response::ModerationFlagListResponse] Wrapper for Kaltura::BaseResponse.
|
|
283
|
+
#
|
|
284
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
|
285
|
+
##
|
|
286
|
+
def list_flags(entry_id, pager=nil)
|
|
287
|
+
kparams = {}
|
|
288
|
+
client.add_param(kparams, 'entryId', entry_id)
|
|
289
|
+
client.add_param(kparams, 'pager', pager)
|
|
290
|
+
perform_request('baseEntry','listFlags',kparams,false)
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
##
|
|
294
|
+
# Anonymously ranks an entry.
|
|
295
|
+
# There is no validation done on duplicate rankings.
|
|
296
|
+
#
|
|
297
|
+
# @param [String] entry_id The Kaltura entry to rank.
|
|
298
|
+
# @param [Integer] rank The rank to assign.
|
|
299
|
+
#
|
|
300
|
+
# @return [nil] Returns nothing.
|
|
301
|
+
#
|
|
302
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
|
303
|
+
##
|
|
304
|
+
def anonymous_rank(entry_id, rank)
|
|
305
|
+
kparams = {}
|
|
306
|
+
client.add_param(kparams, 'entryId', entry_id)
|
|
307
|
+
client.add_param(kparams, 'rank', rank)
|
|
308
|
+
perform_request('baseEntry','anonymousRank',kparams,false)
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
##
|
|
312
|
+
# Retrieves the context data from a Kaltura entry. This is not documented in the API.
|
|
313
|
+
# I'd be cautious about actually using this method.
|
|
314
|
+
#
|
|
315
|
+
# @param [String] entry_id The Kaltura entry.
|
|
316
|
+
# @param [Kaltura::EntryContextDataParams] context_data_params The only field not inherited from Kaltura::ObjectBase
|
|
317
|
+
# is referrer, so I imagine that is what you should set.
|
|
318
|
+
#
|
|
319
|
+
# @return [Kaltura::EntryContextDataResult] Returns some context info, including is the entry restricted by country or session.
|
|
320
|
+
#
|
|
321
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
|
322
|
+
##
|
|
323
|
+
def get_context_data(entry_id, context_data_params)
|
|
324
|
+
kparams = {}
|
|
325
|
+
client.add_param(kparams, 'entryId', entry_id)
|
|
326
|
+
client.add_param(kparams, 'contextDataParams', context_data_params)
|
|
327
|
+
perform_request('baseEntry','getContextData',kparams,false)
|
|
328
|
+
end
|
|
329
|
+
end #class BaseEntryService
|
|
330
|
+
end
|
|
331
|
+
end
|