goncalossilva_kaltura-ruby 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- 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,42 @@
|
|
1
|
+
module Kaltura
|
2
|
+
module Service
|
3
|
+
##
|
4
|
+
# Base Service is a method extraction refactoring performed on the Service module for the Velir
|
5
|
+
# branch of the kaltura-ruby library. Previously perform_request existed in each method of each
|
6
|
+
# service.
|
7
|
+
#
|
8
|
+
# @author Patrick Robertson
|
9
|
+
##
|
10
|
+
class BaseService
|
11
|
+
attr_accessor :client
|
12
|
+
|
13
|
+
def initialize(client)
|
14
|
+
@client = client
|
15
|
+
end
|
16
|
+
|
17
|
+
##
|
18
|
+
# Enqueues the service class, action, and paramters onto the client object and then
|
19
|
+
# informs the client object to perform pop an action off the queue.
|
20
|
+
#
|
21
|
+
# @param [String] service_class The particular class within the Service module.
|
22
|
+
# This translates to a paramter of service=service_class on the http request.
|
23
|
+
# @param [String] service_action The action method performed by the service_class.
|
24
|
+
# This translates to a parameter of action=service_action on the http request.
|
25
|
+
# @param [Boolean] allow_multirequest I've never seen this implemented. It's around
|
26
|
+
# just in case though.
|
27
|
+
#
|
28
|
+
# @return [Object] Returns the result of the request.
|
29
|
+
#
|
30
|
+
# @raise [Kaltura::APIError] Raises the Kaltura error of the request.
|
31
|
+
##
|
32
|
+
def perform_request(service_class,service_action,paramters,allow_multirequest=true)
|
33
|
+
if allow_multirequest == false && client.is_multirequest
|
34
|
+
return nil
|
35
|
+
else
|
36
|
+
client.queue_service_action_call(service_class,service_action,paramters)
|
37
|
+
return client.do_queue
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end #class BaseService
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
module Kaltura
|
2
|
+
module Service
|
3
|
+
##
|
4
|
+
# The Bulk upload service is used to upload and manage bulk uploads using CSV files.
|
5
|
+
# This service is available through the KMC and typically would be a one-off,
|
6
|
+
# though you could choose to use it with a web application.
|
7
|
+
#
|
8
|
+
# @example Create a new bulk upload job:
|
9
|
+
# csv_file = File.open('/path/to/csv_file/')
|
10
|
+
# client.bulk_upload_service.add('12141313',csv_file)
|
11
|
+
#
|
12
|
+
# @example Retrieve a bulk upload status:
|
13
|
+
# status = client.bulk_upload_service.get('124').status
|
14
|
+
#
|
15
|
+
# @example List all bulk upload jobs:
|
16
|
+
# pager = Kaltura::FilterPager.new
|
17
|
+
# pager.page_size = 100000000
|
18
|
+
# client.bulk_upload_service.list(pager)
|
19
|
+
##
|
20
|
+
class BulkUploadService < BaseService
|
21
|
+
|
22
|
+
##
|
23
|
+
# Adds a new bulk upload batch job.
|
24
|
+
# The conversion profile ID can be either specified in the API or in the CSV file itself.
|
25
|
+
# The attribute in the CSV overrides the API ID. The partner's default conversion profile
|
26
|
+
# will be used if no ID is provided.
|
27
|
+
#
|
28
|
+
# @param [Integer] conversion_profile_id This is the conversion profile to create flavors for each entry from.
|
29
|
+
# If there is a conversion profile defined in the file, this paramter will be overriden.
|
30
|
+
# @param [File] csv_file_data The CSV file used to batch upload.
|
31
|
+
#
|
32
|
+
# @return [Kaltura::BulkUpload] A Bulk upload object contains useful information regarding the batch upload status.
|
33
|
+
# It would be advised you store the ID of this object somewhere for later retrieval.
|
34
|
+
#
|
35
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
36
|
+
##
|
37
|
+
def add(conversion_profile_id, csv_file_data)
|
38
|
+
kparams = {}
|
39
|
+
client.add_param(kparams, 'conversionProfileId', conversion_profile_id)
|
40
|
+
client.add_param(kparams, 'csvFileData', csv_file_data)
|
41
|
+
perform_request('bulkUpload','add',kparams,false)
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
# Retrieves a BulkUpload object.
|
46
|
+
#
|
47
|
+
# @param [Integer] id The ID of the BulkUpload object.
|
48
|
+
#
|
49
|
+
# @return [Kaltura::BulkUpload] The BulkUpload object requested.
|
50
|
+
#
|
51
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
52
|
+
##
|
53
|
+
def get(id)
|
54
|
+
kparams = {}
|
55
|
+
client.add_param(kparams, 'id', id)
|
56
|
+
perform_request('bulkUpload','get',kparams,false)
|
57
|
+
end
|
58
|
+
|
59
|
+
##
|
60
|
+
# Lists bulk upload batch jobs given a pager index and size.
|
61
|
+
#
|
62
|
+
# @param [Kaltura::FilterPager] pager Default Kaltura pager object.
|
63
|
+
#
|
64
|
+
# @return [Kaltura::Response::BulkUploadListResponse] Wrapper for BaseResponse.
|
65
|
+
#
|
66
|
+
# @return [Kaltura::APIError] Raises default Kaltura errors.
|
67
|
+
##
|
68
|
+
def list(pager=nil)
|
69
|
+
kparams = {}
|
70
|
+
client.add_param(kparams, 'pager', pager)
|
71
|
+
perform_request('bulkUpload','list',kparams,false)
|
72
|
+
end
|
73
|
+
end #class BulkUploadService
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
module Kaltura
|
2
|
+
module Service
|
3
|
+
##
|
4
|
+
# CategoryService is responsible for adding and managing Categories. Categories are the main
|
5
|
+
# means to filter entries within the KMC.
|
6
|
+
#
|
7
|
+
# @example Add a new category to the KMC filter list.
|
8
|
+
# new_category = Kaltura::Category.new
|
9
|
+
# new_category.name = "waffles"
|
10
|
+
# client.category_service.add(new_category)
|
11
|
+
#
|
12
|
+
# @example Get an existing category by ID.
|
13
|
+
# client.category_service.get(214)
|
14
|
+
#
|
15
|
+
# @example Update an existing category.
|
16
|
+
# category_update = Kaltura::Category.new
|
17
|
+
# category_update.description = "waffles are pretty freaking good."
|
18
|
+
# client.category_service.update(214,category_update)
|
19
|
+
#
|
20
|
+
# @example Delete an existing category.
|
21
|
+
# client.category_service.delete(214)
|
22
|
+
#
|
23
|
+
# @example List all categories with a parent_id of 2
|
24
|
+
# category_filter = Kaltura::Filter::CategoryFilter.new
|
25
|
+
# category_filter.parent_id_equal = 2
|
26
|
+
# client.category_service.list(category_filter)
|
27
|
+
##
|
28
|
+
class CategoryService < BaseService
|
29
|
+
|
30
|
+
##
|
31
|
+
# Adds a new Category.
|
32
|
+
#
|
33
|
+
# @param [Kaltura::Category] category The category that will be created. The crucial field to fill out is name.
|
34
|
+
#
|
35
|
+
# @return [Kaltura::Category] Returns the category as it now appears on the server. It would be beneficial to
|
36
|
+
# save the ID of the category for later reference.
|
37
|
+
#
|
38
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
39
|
+
##
|
40
|
+
def add(category)
|
41
|
+
kparams = {}
|
42
|
+
client.add_param(kparams, 'category', category)
|
43
|
+
perform_request('category','add',kparams,false)
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Retrieves a category by it's ID.
|
48
|
+
#
|
49
|
+
# @param [Integer] id The Kaltura::Category object's id.
|
50
|
+
#
|
51
|
+
# @return [Kaltura::Category] The requested category.
|
52
|
+
#
|
53
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
54
|
+
##
|
55
|
+
def get(id)
|
56
|
+
kparams = {}
|
57
|
+
client.add_param(kparams, 'id', id)
|
58
|
+
perform_request('category','get',kparams,false)
|
59
|
+
end
|
60
|
+
|
61
|
+
##
|
62
|
+
# Updates a category.
|
63
|
+
# The best practice as with all updates would be to insantiate a new Kaltura::Category and update specific fields.
|
64
|
+
#
|
65
|
+
# @param [Integer] id The Kaltura::Category id of the category to be updated.
|
66
|
+
# @param [Kaltura::Category] A newly insantiated Category object with the fields updated that you'd like to update.
|
67
|
+
#
|
68
|
+
# @return [Kaltura::Category] The new and improved Category object.
|
69
|
+
#
|
70
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
71
|
+
##
|
72
|
+
def update(id, category)
|
73
|
+
kparams = {}
|
74
|
+
client.add_param(kparams, 'id', id)
|
75
|
+
client.add_param(kparams, 'category', category)
|
76
|
+
perform_request('category','update',kparams,false)
|
77
|
+
end
|
78
|
+
|
79
|
+
##
|
80
|
+
# Deletes the requested Category.
|
81
|
+
# I am fairly confident that this will not actually clear the category from each entry, but it is no longer
|
82
|
+
# a filter on the KMC.
|
83
|
+
#
|
84
|
+
# @param [Integer] id The category ID to remove.
|
85
|
+
#
|
86
|
+
# @return [nil] Returns nothing.
|
87
|
+
#
|
88
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
89
|
+
##
|
90
|
+
def delete(id)
|
91
|
+
kparams = {}
|
92
|
+
client.add_param(kparams, 'id', id)
|
93
|
+
perform_request('category','delete',kparams,false)
|
94
|
+
end
|
95
|
+
|
96
|
+
##
|
97
|
+
# Lists all Categories given the specified filter.
|
98
|
+
#
|
99
|
+
# @param [Kaltura::Filter::CategoryFilter] filter The filter to apply.
|
100
|
+
#
|
101
|
+
# @return [Kaltura::Response::CategoryListResponse] Wrapper for Kaltura::Response::BaseResponse.
|
102
|
+
#
|
103
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
104
|
+
##
|
105
|
+
def list(filter=nil)
|
106
|
+
kparams = {}
|
107
|
+
client.add_param(kparams, 'filter', filter)
|
108
|
+
perform_request('category','list',kparams,false)
|
109
|
+
end
|
110
|
+
end #class CategoryService
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,116 @@
|
|
1
|
+
module Kaltura
|
2
|
+
module Service
|
3
|
+
|
4
|
+
##
|
5
|
+
# The Conversion Profile Service is responsible for adding and managing conversion profiles.
|
6
|
+
#
|
7
|
+
# @example Create a new conversion profile:
|
8
|
+
# conversion_profile = Kaltura::ConversionProfile.new
|
9
|
+
# conversion_profile.name = "waffles"
|
10
|
+
# conversion_profile.is_default = "true"
|
11
|
+
# conversion_profile.clip_duration = 15
|
12
|
+
# client.conversion_profile_service.add(conversion_profile)
|
13
|
+
#
|
14
|
+
# @example Retrieve a conversion profile:
|
15
|
+
# client.conversion_profile_service.get(224)
|
16
|
+
#
|
17
|
+
# @example Update a conversion profile:
|
18
|
+
# update_profile = Kaltura::ConversionProfile.new
|
19
|
+
# update_profile.description = "why does the documentor love waffles so much?"
|
20
|
+
# update_profile.clip_start = 3
|
21
|
+
# client.conversion_profile_service.update(224,update_profile)
|
22
|
+
#
|
23
|
+
# @example Delete a conversion profile:
|
24
|
+
# client.conversion_profile_service.delete(224)
|
25
|
+
#
|
26
|
+
# @example Retrieve all conversion profiles with an ID of 224
|
27
|
+
# filter = Kaltura::Filter::ConversionProfileFilter.new
|
28
|
+
# filter.id_equal = 224
|
29
|
+
# client.conversion_profile_service.list(filter)
|
30
|
+
##
|
31
|
+
class ConversionProfileService < BaseService
|
32
|
+
|
33
|
+
##
|
34
|
+
# Adds a new conversion profile.
|
35
|
+
#
|
36
|
+
# @param [Kaltura::ConversionProfile] conversion_profile The new conversion profile.
|
37
|
+
#
|
38
|
+
# @return [Kaltura::ConversionProfile] The conversion profile as it is stored on the Kaltura server.
|
39
|
+
# It might be important to store the ID returned.
|
40
|
+
#
|
41
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
42
|
+
##
|
43
|
+
def add(conversion_profile)
|
44
|
+
kparams = {}
|
45
|
+
client.add_param(kparams, 'conversionProfile', conversion_profile)
|
46
|
+
perform_request('conversionProfile','add',kparams,false)
|
47
|
+
end
|
48
|
+
|
49
|
+
##
|
50
|
+
# Retrieves a conversion profile by ID.
|
51
|
+
#
|
52
|
+
# @param [Integer] id The conversion profile ID.
|
53
|
+
#
|
54
|
+
# @return [Kaltura::ConversionProfile] The requested conversion profile.
|
55
|
+
#
|
56
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
57
|
+
##
|
58
|
+
def get(id)
|
59
|
+
kparams = {}
|
60
|
+
client.add_param(kparams, 'id', id)
|
61
|
+
perform_request('conversionProfile','get',kparams,false)
|
62
|
+
end
|
63
|
+
|
64
|
+
##
|
65
|
+
# Updates a conversion profile given an ID and a newly instantiated ConversionProfile.
|
66
|
+
# It will update any populated fields on the provided profile.
|
67
|
+
#
|
68
|
+
# @param [Integer] id The conversion profile ID.
|
69
|
+
# @param [Kaltura::ConversionProfile] conversion_profile Newly instantiated conversion profile with
|
70
|
+
# the fields to update.
|
71
|
+
#
|
72
|
+
# @return [Kaltura::ConversionProfile] Returns an updated conversion profile.
|
73
|
+
#
|
74
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
75
|
+
##
|
76
|
+
def update(id, conversion_profile)
|
77
|
+
kparams = {}
|
78
|
+
client.add_param(kparams, 'id', id)
|
79
|
+
client.add_param(kparams, 'conversionProfile', conversion_profile)
|
80
|
+
perform_request('conversionProfile','update',kparams,false)
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# Deletes a conversion profile by ID.
|
85
|
+
#
|
86
|
+
# @param [Integer] id The conversion profile ID.
|
87
|
+
#
|
88
|
+
# @return [nil] Returns nothing.
|
89
|
+
#
|
90
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
91
|
+
##
|
92
|
+
def delete(id)
|
93
|
+
kparams = {}
|
94
|
+
client.add_param(kparams, 'id', id)
|
95
|
+
perform_request('conversionProfile','delete',kparams,false)
|
96
|
+
end
|
97
|
+
|
98
|
+
##
|
99
|
+
# Lists conversion profiles given a filter with paging support for larger result sets.
|
100
|
+
#
|
101
|
+
# @param [Kaltura::Filter::ConversionProfileFilter] filter The filter to apply to the list.
|
102
|
+
# @param [Kaltura::FilterPager] pager Default Kaltura Pager.
|
103
|
+
#
|
104
|
+
# @return [Kaltura::Response::ConversionProfileListResponse] Wrapper for Kaltura::Response::BaseResponse.
|
105
|
+
#
|
106
|
+
# @raise [Kaltura::APIError] Raises default Kaltura errors.
|
107
|
+
##
|
108
|
+
def list(filter=nil, pager=nil)
|
109
|
+
kparams = {}
|
110
|
+
client.add_param(kparams, 'filter', filter)
|
111
|
+
client.add_param(kparams, 'pager', pager)
|
112
|
+
perform_request('conversionProfile','list',kparams,false)
|
113
|
+
end
|
114
|
+
end #class ConversionProfileService
|
115
|
+
end
|
116
|
+
end
|
@@ -0,0 +1,116 @@
|
|
1
|
+
module Kaltura
|
2
|
+
module Service
|
3
|
+
##
|
4
|
+
# The Data Service allows you to add and manage texual content.
|
5
|
+
#
|
6
|
+
# @example Creating a new DataEntry:
|
7
|
+
# new_data_entry = Kaltura::DataEntry.new
|
8
|
+
# new_data_entry.name = "pancake"
|
9
|
+
# new_data_entry.data_content = "We all know that waffles are better. But the documentation author is tired."
|
10
|
+
# client.data_entry_service.add(new_data_entry)
|
11
|
+
#
|
12
|
+
# @example Retrieve a DataEntry:
|
13
|
+
# client.data_entry_service.get('1_ad342xk')
|
14
|
+
#
|
15
|
+
# @example Update a DataEntry:
|
16
|
+
# update_entry = Kaltura::DataEntry.new
|
17
|
+
# update_entry.data_content = 'Ninjas <3 waffles. Pirates love the pancakes.'
|
18
|
+
# client.data_entry_service.update('1_ad342xk',update_entry)
|
19
|
+
#
|
20
|
+
# @example Delete a DataEntry:
|
21
|
+
# client.data_entry_service.delete('1_ad342xk')
|
22
|
+
#
|
23
|
+
# @example Filter DataEntries by group ID 2:
|
24
|
+
# filter = Kaltura::Filter::DataEntryFilter.new
|
25
|
+
# filter.group_id_equal = '2'
|
26
|
+
# client.data_entry_service.list(filter)
|
27
|
+
##
|
28
|
+
class DataService < BaseService
|
29
|
+
|
30
|
+
##
|
31
|
+
# Adds a new data entry.
|
32
|
+
#
|
33
|
+
# @param [Kaltura::DataEntry] data_entry This is essentially a BaseEntry except there
|
34
|
+
# is a field called data_content. Presumably you shove text into this field.
|
35
|
+
#
|
36
|
+
# @return [Kaltura::DataEntry] Returns the data entry as it is stored in the DB.
|
37
|
+
#
|
38
|
+
# @raise [Kaltura::APIError] Raises the default Kaltura errors.
|
39
|
+
##
|
40
|
+
def add(data_entry)
|
41
|
+
kparams = {}
|
42
|
+
client.add_param(kparams, 'dataEntry', data_entry)
|
43
|
+
perform_request('data','add',kparams,false)
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Gets a data entry by ID.
|
48
|
+
#
|
49
|
+
# @param [String] entry_id the DataEntry id.
|
50
|
+
# @param [Integer] version Version of the DataEntry.
|
51
|
+
#
|
52
|
+
# @return [Kaltura::DataEntry] Returns the desired DataEntry object.
|
53
|
+
#
|
54
|
+
# @raise [Kaltura::APIError] Raises the default Kaltura errors in addition to 'ENTRY_ID_NOT_FOUND'.
|
55
|
+
##
|
56
|
+
def get(entry_id, version=-1)
|
57
|
+
kparams = {}
|
58
|
+
client.add_param(kparams, 'entryId', entry_id)
|
59
|
+
client.add_param(kparams, 'version', version)
|
60
|
+
perform_request('data','get',kparams,false)
|
61
|
+
end
|
62
|
+
|
63
|
+
##
|
64
|
+
# Updates a data entry.
|
65
|
+
# As with other update actions, the best practice is to instantiate a new Kaltura::DataEntry object
|
66
|
+
# and set the fields of that object that you wish to change.
|
67
|
+
#
|
68
|
+
# @param [String] entry_id The DataEntry you wish to update.
|
69
|
+
# @param [Kaltura::DataEntry] document_entry A newly instantiated DataEntry object with only
|
70
|
+
# the fields that you wish to update filled in.
|
71
|
+
#
|
72
|
+
# @return [Kaltura::DataEntry] Returns the updated DataEntry object complete with a version bump.
|
73
|
+
#
|
74
|
+
# @raise [Kaltura::APIError] Raises the default Kaltura errors in addition to 'ENTRY_ID_NOT_FOUND'.
|
75
|
+
##
|
76
|
+
def update(entry_id, document_entry)
|
77
|
+
kparams = {}
|
78
|
+
client.add_param(kparams, 'entryId', entry_id)
|
79
|
+
client.add_param(kparams, 'documentEntry', document_entry)
|
80
|
+
perform_request('data','update',kparams,false)
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# Removes a DataEntry object.
|
85
|
+
#
|
86
|
+
# @param [String] entry_id the DataEntry to delete.
|
87
|
+
#
|
88
|
+
# @return [nil] Returns nothing.
|
89
|
+
#
|
90
|
+
# @raise [Kaltura::APIError] Raises the default Kaltura errors in addition to 'ENTRY_ID_NOT_FOUND'.
|
91
|
+
##
|
92
|
+
def delete(entry_id)
|
93
|
+
kparams = {}
|
94
|
+
client.add_param(kparams, 'entryId', entry_id)
|
95
|
+
perform_request('data','delete',kparams,false)
|
96
|
+
end
|
97
|
+
|
98
|
+
##
|
99
|
+
# Lists DataEntry objects with the given filter and paging support for larger sets of data.
|
100
|
+
#
|
101
|
+
# @param [Kaltura::Filter::DataEntryFilter] filter The filter to apply to the list.
|
102
|
+
# @param [Kaltura::FilterPager] pager The default Kaltura pager.
|
103
|
+
#
|
104
|
+
# @return [Kaltura::Response::DataListResponse] Wrapper for Kaltura::Response::BaseResponse.
|
105
|
+
#
|
106
|
+
# @raise [Kaltura::APIError] Raises the default Kaltura errrors.
|
107
|
+
##
|
108
|
+
def list(filter=nil, pager=nil)
|
109
|
+
kparams = {}
|
110
|
+
client.add_param(kparams, 'filter', filter)
|
111
|
+
client.add_param(kparams, 'pager', pager)
|
112
|
+
perform_request('data','list',kparams,false)
|
113
|
+
end
|
114
|
+
end #class DataService
|
115
|
+
end
|
116
|
+
end
|