kaltura-ruby-client 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/README +20 -0
  3. data/Rakefile +19 -0
  4. data/agpl.txt +674 -0
  5. data/kaltura.yml +7 -0
  6. data/lib/kaltura.rb +31 -0
  7. data/lib/kaltura_client.rb +14450 -0
  8. data/lib/kaltura_client_base.rb +432 -0
  9. data/lib/kaltura_plugins/kaltura_abc_screeners_watermark_access_control_client_plugin.rb +37 -0
  10. data/lib/kaltura_plugins/kaltura_ad_cue_point_client_plugin.rb +108 -0
  11. data/lib/kaltura_plugins/kaltura_annotation_client_plugin.rb +237 -0
  12. data/lib/kaltura_plugins/kaltura_aspera_client_plugin.rb +61 -0
  13. data/lib/kaltura_plugins/kaltura_attachment_client_plugin.rb +227 -0
  14. data/lib/kaltura_plugins/kaltura_audit_client_plugin.rb +349 -0
  15. data/lib/kaltura_plugins/kaltura_bulk_upload_client_plugin.rb +109 -0
  16. data/lib/kaltura_plugins/kaltura_bulk_upload_csv_client_plugin.rb +55 -0
  17. data/lib/kaltura_plugins/kaltura_bulk_upload_filter_client_plugin.rb +46 -0
  18. data/lib/kaltura_plugins/kaltura_bulk_upload_xml_client_plugin.rb +40 -0
  19. data/lib/kaltura_plugins/kaltura_caption_client_plugin.rb +406 -0
  20. data/lib/kaltura_plugins/kaltura_caption_search_client_plugin.rb +138 -0
  21. data/lib/kaltura_plugins/kaltura_code_cue_point_client_plugin.rb +97 -0
  22. data/lib/kaltura_plugins/kaltura_content_distribution_client_plugin.rb +1717 -0
  23. data/lib/kaltura_plugins/kaltura_cue_point_client_plugin.rb +290 -0
  24. data/lib/kaltura_plugins/kaltura_document_client_plugin.rb +522 -0
  25. data/lib/kaltura_plugins/kaltura_drm_client_plugin.rb +204 -0
  26. data/lib/kaltura_plugins/kaltura_drop_folder_client_plugin.rb +810 -0
  27. data/lib/kaltura_plugins/kaltura_drop_folder_xml_bulk_upload_client_plugin.rb +39 -0
  28. data/lib/kaltura_plugins/kaltura_email_notification_client_plugin.rb +276 -0
  29. data/lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb +405 -0
  30. data/lib/kaltura_plugins/kaltura_external_media_client_plugin.rb +203 -0
  31. data/lib/kaltura_plugins/kaltura_file_sync_client_plugin.rb +151 -0
  32. data/lib/kaltura_plugins/kaltura_http_notification_client_plugin.rb +309 -0
  33. data/lib/kaltura_plugins/kaltura_kontiki_client_plugin.rb +72 -0
  34. data/lib/kaltura_plugins/kaltura_like_client_plugin.rb +82 -0
  35. data/lib/kaltura_plugins/kaltura_metadata_client_plugin.rb +788 -0
  36. data/lib/kaltura_plugins/kaltura_multi_centers_client_plugin.rb +45 -0
  37. data/lib/kaltura_plugins/kaltura_short_link_client_plugin.rb +231 -0
  38. data/lib/kaltura_plugins/kaltura_tag_search_client_plugin.rb +145 -0
  39. data/lib/kaltura_plugins/kaltura_var_console_client_plugin.rb +238 -0
  40. data/lib/kaltura_plugins/kaltura_velocix_client_plugin.rb +40 -0
  41. data/lib/kaltura_plugins/kaltura_virus_scan_client_plugin.rb +263 -0
  42. data/lib/kaltura_plugins/kaltura_webex_drop_folder_client_plugin.rb +121 -0
  43. data/lib/kaltura_plugins/kaltura_widevine_client_plugin.rb +195 -0
  44. data/license.txt +674 -0
  45. data/test/access_control_service_test.rb +75 -0
  46. data/test/base_entry_service_test.rb +267 -0
  47. data/test/configuration_test.rb +178 -0
  48. data/test/cue_point_service_test.rb +67 -0
  49. data/test/data_service_test.rb +76 -0
  50. data/test/document_service_test.rb +41 -0
  51. data/test/media/test.mov +0 -0
  52. data/test/media/test.pdf +0 -0
  53. data/test/media/test.png +0 -0
  54. data/test/media/test.swf +0 -0
  55. data/test/media/test.wmv +0 -0
  56. data/test/media_service_test.rb +294 -0
  57. data/test/metadata_profile_service_test.rb +63 -0
  58. data/test/test_helper.rb +59 -0
  59. metadata +127 -0
@@ -0,0 +1,290 @@
1
+ # ===================================================================================================
2
+ # _ __ _ _
3
+ # | |/ /__ _| | |_ _ _ _ _ __ _
4
+ # | ' </ _` | | _| || | '_/ _` |
5
+ # |_|\_\__,_|_|\__|\_,_|_| \__,_|
6
+ #
7
+ # This file is part of the Kaltura Collaborative Media Suite which allows users
8
+ # to do with audio, video, and animation what Wiki platfroms allow them to do with
9
+ # text.
10
+ #
11
+ # Copyright (C) 2006-2011 Kaltura Inc.
12
+ #
13
+ # This program is free software: you can redistribute it and/or modify
14
+ # it under the terms of the GNU Affero General Public License as
15
+ # published by the Free Software Foundation, either version 3 of the
16
+ # License, or (at your option) any later version.
17
+ #
18
+ # This program is distributed in the hope that it will be useful,
19
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ # GNU Affero General Public License for more details.
22
+ #
23
+ # You should have received a copy of the GNU Affero General Public License
24
+ # along with this program. If not, see <http:#www.gnu.org/licenses/>.
25
+ #
26
+ # @ignore
27
+ # ===================================================================================================
28
+ require 'kaltura_client.rb'
29
+
30
+ module Kaltura
31
+
32
+ class KalturaCuePointStatus
33
+ READY = 1
34
+ DELETED = 2
35
+ end
36
+
37
+ class KalturaCuePointOrderBy
38
+ CREATED_AT_ASC = "+createdAt"
39
+ PARTNER_SORT_VALUE_ASC = "+partnerSortValue"
40
+ START_TIME_ASC = "+startTime"
41
+ UPDATED_AT_ASC = "+updatedAt"
42
+ CREATED_AT_DESC = "-createdAt"
43
+ PARTNER_SORT_VALUE_DESC = "-partnerSortValue"
44
+ START_TIME_DESC = "-startTime"
45
+ UPDATED_AT_DESC = "-updatedAt"
46
+ end
47
+
48
+ class KalturaCuePointType
49
+ AD = "adCuePoint.Ad"
50
+ ANNOTATION = "annotation.Annotation"
51
+ CODE = "codeCuePoint.Code"
52
+ end
53
+
54
+ class KalturaCuePoint < KalturaObjectBase
55
+ attr_accessor :id
56
+ attr_accessor :cue_point_type
57
+ attr_accessor :status
58
+ attr_accessor :entry_id
59
+ attr_accessor :partner_id
60
+ attr_accessor :created_at
61
+ attr_accessor :updated_at
62
+ attr_accessor :tags
63
+ # Start time in milliseconds
64
+ #
65
+ attr_accessor :start_time
66
+ attr_accessor :user_id
67
+ attr_accessor :partner_data
68
+ attr_accessor :partner_sort_value
69
+ attr_accessor :force_stop
70
+ attr_accessor :thumb_offset
71
+ attr_accessor :system_name
72
+
73
+ def status=(val)
74
+ @status = val.to_i
75
+ end
76
+ def partner_id=(val)
77
+ @partner_id = val.to_i
78
+ end
79
+ def created_at=(val)
80
+ @created_at = val.to_i
81
+ end
82
+ def updated_at=(val)
83
+ @updated_at = val.to_i
84
+ end
85
+ def start_time=(val)
86
+ @start_time = val.to_i
87
+ end
88
+ def partner_sort_value=(val)
89
+ @partner_sort_value = val.to_i
90
+ end
91
+ def force_stop=(val)
92
+ @force_stop = val.to_i
93
+ end
94
+ def thumb_offset=(val)
95
+ @thumb_offset = val.to_i
96
+ end
97
+ end
98
+
99
+ class KalturaCuePointListResponse < KalturaObjectBase
100
+ attr_accessor :objects
101
+ attr_accessor :total_count
102
+
103
+ def total_count=(val)
104
+ @total_count = val.to_i
105
+ end
106
+ end
107
+
108
+ class KalturaCuePointBaseFilter < KalturaFilter
109
+ attr_accessor :id_equal
110
+ attr_accessor :id_in
111
+ attr_accessor :cue_point_type_equal
112
+ attr_accessor :cue_point_type_in
113
+ attr_accessor :status_equal
114
+ attr_accessor :status_in
115
+ attr_accessor :entry_id_equal
116
+ attr_accessor :entry_id_in
117
+ attr_accessor :created_at_greater_than_or_equal
118
+ attr_accessor :created_at_less_than_or_equal
119
+ attr_accessor :updated_at_greater_than_or_equal
120
+ attr_accessor :updated_at_less_than_or_equal
121
+ attr_accessor :tags_like
122
+ attr_accessor :tags_multi_like_or
123
+ attr_accessor :tags_multi_like_and
124
+ attr_accessor :start_time_greater_than_or_equal
125
+ attr_accessor :start_time_less_than_or_equal
126
+ attr_accessor :user_id_equal
127
+ attr_accessor :user_id_in
128
+ attr_accessor :partner_sort_value_equal
129
+ attr_accessor :partner_sort_value_in
130
+ attr_accessor :partner_sort_value_greater_than_or_equal
131
+ attr_accessor :partner_sort_value_less_than_or_equal
132
+ attr_accessor :force_stop_equal
133
+ attr_accessor :system_name_equal
134
+ attr_accessor :system_name_in
135
+
136
+ def status_equal=(val)
137
+ @status_equal = val.to_i
138
+ end
139
+ def created_at_greater_than_or_equal=(val)
140
+ @created_at_greater_than_or_equal = val.to_i
141
+ end
142
+ def created_at_less_than_or_equal=(val)
143
+ @created_at_less_than_or_equal = val.to_i
144
+ end
145
+ def updated_at_greater_than_or_equal=(val)
146
+ @updated_at_greater_than_or_equal = val.to_i
147
+ end
148
+ def updated_at_less_than_or_equal=(val)
149
+ @updated_at_less_than_or_equal = val.to_i
150
+ end
151
+ def start_time_greater_than_or_equal=(val)
152
+ @start_time_greater_than_or_equal = val.to_i
153
+ end
154
+ def start_time_less_than_or_equal=(val)
155
+ @start_time_less_than_or_equal = val.to_i
156
+ end
157
+ def partner_sort_value_equal=(val)
158
+ @partner_sort_value_equal = val.to_i
159
+ end
160
+ def partner_sort_value_greater_than_or_equal=(val)
161
+ @partner_sort_value_greater_than_or_equal = val.to_i
162
+ end
163
+ def partner_sort_value_less_than_or_equal=(val)
164
+ @partner_sort_value_less_than_or_equal = val.to_i
165
+ end
166
+ def force_stop_equal=(val)
167
+ @force_stop_equal = val.to_i
168
+ end
169
+ end
170
+
171
+ class KalturaCuePointFilter < KalturaCuePointBaseFilter
172
+
173
+ end
174
+
175
+
176
+ # Cue Point service
177
+ #
178
+ class KalturaCuePointService < KalturaServiceBase
179
+ def initialize(client)
180
+ super(client)
181
+ end
182
+
183
+ # Allows you to add an cue point object associated with an entry
184
+ #
185
+ def add(cue_point)
186
+ kparams = {}
187
+ client.add_param(kparams, 'cuePoint', cue_point);
188
+ client.queue_service_action_call('cuepoint_cuepoint', 'add', kparams);
189
+ if (client.is_multirequest)
190
+ return nil;
191
+ end
192
+ return client.do_queue();
193
+ end
194
+
195
+ # Allows you to add multiple cue points objects by uploading XML that contains multiple cue point definitions
196
+ #
197
+ def add_from_bulk(file_data)
198
+ kparams = {}
199
+ client.add_param(kparams, 'fileData', file_data);
200
+ client.queue_service_action_call('cuepoint_cuepoint', 'addFromBulk', kparams);
201
+ if (client.is_multirequest)
202
+ return nil;
203
+ end
204
+ return client.do_queue();
205
+ end
206
+
207
+ # Download multiple cue points objects as XML definitions
208
+ #
209
+ def serve_bulk(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
210
+ kparams = {}
211
+ client.add_param(kparams, 'filter', filter);
212
+ client.add_param(kparams, 'pager', pager);
213
+ client.queue_service_action_call('cuepoint_cuepoint', 'serveBulk', kparams);
214
+ return client.get_serve_url();
215
+ end
216
+
217
+ # Retrieve an CuePoint object by id
218
+ #
219
+ def get(id)
220
+ kparams = {}
221
+ client.add_param(kparams, 'id', id);
222
+ client.queue_service_action_call('cuepoint_cuepoint', 'get', kparams);
223
+ if (client.is_multirequest)
224
+ return nil;
225
+ end
226
+ return client.do_queue();
227
+ end
228
+
229
+ # List cue point objects by filter and pager
230
+ #
231
+ def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
232
+ kparams = {}
233
+ client.add_param(kparams, 'filter', filter);
234
+ client.add_param(kparams, 'pager', pager);
235
+ client.queue_service_action_call('cuepoint_cuepoint', 'list', kparams);
236
+ if (client.is_multirequest)
237
+ return nil;
238
+ end
239
+ return client.do_queue();
240
+ end
241
+
242
+ # count cue point objects by filter
243
+ #
244
+ def count(filter=KalturaNotImplemented)
245
+ kparams = {}
246
+ client.add_param(kparams, 'filter', filter);
247
+ client.queue_service_action_call('cuepoint_cuepoint', 'count', kparams);
248
+ if (client.is_multirequest)
249
+ return nil;
250
+ end
251
+ return client.do_queue();
252
+ end
253
+
254
+ # Update cue point by id
255
+ #
256
+ def update(id, cue_point)
257
+ kparams = {}
258
+ client.add_param(kparams, 'id', id);
259
+ client.add_param(kparams, 'cuePoint', cue_point);
260
+ client.queue_service_action_call('cuepoint_cuepoint', 'update', kparams);
261
+ if (client.is_multirequest)
262
+ return nil;
263
+ end
264
+ return client.do_queue();
265
+ end
266
+
267
+ # delete cue point by id, and delete all children cue points
268
+ #
269
+ def delete(id)
270
+ kparams = {}
271
+ client.add_param(kparams, 'id', id);
272
+ client.queue_service_action_call('cuepoint_cuepoint', 'delete', kparams);
273
+ if (client.is_multirequest)
274
+ return nil;
275
+ end
276
+ return client.do_queue();
277
+ end
278
+ end
279
+
280
+ class KalturaClient < KalturaClientBase
281
+ attr_reader :cue_point_service
282
+ def cue_point_service
283
+ if (@cue_point_service == nil)
284
+ @cue_point_service = KalturaCuePointService.new(self)
285
+ end
286
+ return @cue_point_service
287
+ end
288
+ end
289
+
290
+ end
@@ -0,0 +1,522 @@
1
+ # ===================================================================================================
2
+ # _ __ _ _
3
+ # | |/ /__ _| | |_ _ _ _ _ __ _
4
+ # | ' </ _` | | _| || | '_/ _` |
5
+ # |_|\_\__,_|_|\__|\_,_|_| \__,_|
6
+ #
7
+ # This file is part of the Kaltura Collaborative Media Suite which allows users
8
+ # to do with audio, video, and animation what Wiki platfroms allow them to do with
9
+ # text.
10
+ #
11
+ # Copyright (C) 2006-2011 Kaltura Inc.
12
+ #
13
+ # This program is free software: you can redistribute it and/or modify
14
+ # it under the terms of the GNU Affero General Public License as
15
+ # published by the Free Software Foundation, either version 3 of the
16
+ # License, or (at your option) any later version.
17
+ #
18
+ # This program is distributed in the hope that it will be useful,
19
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ # GNU Affero General Public License for more details.
22
+ #
23
+ # You should have received a copy of the GNU Affero General Public License
24
+ # along with this program. If not, see <http:#www.gnu.org/licenses/>.
25
+ #
26
+ # @ignore
27
+ # ===================================================================================================
28
+ require 'kaltura_client.rb'
29
+
30
+ module Kaltura
31
+
32
+ class KalturaDocumentType
33
+ DOCUMENT = 11
34
+ SWF = 12
35
+ PDF = 13
36
+ end
37
+
38
+ class KalturaDocumentEntryOrderBy
39
+ CREATED_AT_ASC = "+createdAt"
40
+ END_DATE_ASC = "+endDate"
41
+ MODERATION_COUNT_ASC = "+moderationCount"
42
+ NAME_ASC = "+name"
43
+ PARTNER_SORT_VALUE_ASC = "+partnerSortValue"
44
+ RANK_ASC = "+rank"
45
+ RECENT_ASC = "+recent"
46
+ START_DATE_ASC = "+startDate"
47
+ TOTAL_RANK_ASC = "+totalRank"
48
+ UPDATED_AT_ASC = "+updatedAt"
49
+ WEIGHT_ASC = "+weight"
50
+ CREATED_AT_DESC = "-createdAt"
51
+ END_DATE_DESC = "-endDate"
52
+ MODERATION_COUNT_DESC = "-moderationCount"
53
+ NAME_DESC = "-name"
54
+ PARTNER_SORT_VALUE_DESC = "-partnerSortValue"
55
+ RANK_DESC = "-rank"
56
+ RECENT_DESC = "-recent"
57
+ START_DATE_DESC = "-startDate"
58
+ TOTAL_RANK_DESC = "-totalRank"
59
+ UPDATED_AT_DESC = "-updatedAt"
60
+ WEIGHT_DESC = "-weight"
61
+ end
62
+
63
+ class KalturaDocumentFlavorParamsOrderBy
64
+ end
65
+
66
+ class KalturaDocumentFlavorParamsOutputOrderBy
67
+ end
68
+
69
+ class KalturaImageFlavorParamsOrderBy
70
+ end
71
+
72
+ class KalturaImageFlavorParamsOutputOrderBy
73
+ end
74
+
75
+ class KalturaPdfFlavorParamsOrderBy
76
+ end
77
+
78
+ class KalturaPdfFlavorParamsOutputOrderBy
79
+ end
80
+
81
+ class KalturaSwfFlavorParamsOrderBy
82
+ end
83
+
84
+ class KalturaSwfFlavorParamsOutputOrderBy
85
+ end
86
+
87
+ class KalturaDocumentEntry < KalturaBaseEntry
88
+ # The type of the document
89
+ #
90
+ attr_accessor :document_type
91
+ # Comma separated asset params ids that exists for this media entry
92
+ #
93
+ attr_accessor :asset_params_ids
94
+
95
+ def document_type=(val)
96
+ @document_type = val.to_i
97
+ end
98
+ end
99
+
100
+ class KalturaDocumentListResponse < KalturaObjectBase
101
+ attr_accessor :objects
102
+ attr_accessor :total_count
103
+
104
+ def total_count=(val)
105
+ @total_count = val.to_i
106
+ end
107
+ end
108
+
109
+ class KalturaDocumentFlavorParams < KalturaFlavorParams
110
+
111
+ end
112
+
113
+ class KalturaImageFlavorParams < KalturaFlavorParams
114
+ attr_accessor :density_width
115
+ attr_accessor :density_height
116
+ attr_accessor :size_width
117
+ attr_accessor :size_height
118
+ attr_accessor :depth
119
+
120
+ def density_width=(val)
121
+ @density_width = val.to_i
122
+ end
123
+ def density_height=(val)
124
+ @density_height = val.to_i
125
+ end
126
+ def size_width=(val)
127
+ @size_width = val.to_i
128
+ end
129
+ def size_height=(val)
130
+ @size_height = val.to_i
131
+ end
132
+ def depth=(val)
133
+ @depth = val.to_i
134
+ end
135
+ end
136
+
137
+ class KalturaPdfFlavorParams < KalturaFlavorParams
138
+ attr_accessor :readonly
139
+
140
+ def readonly=(val)
141
+ @readonly = to_b(val)
142
+ end
143
+ end
144
+
145
+ class KalturaSwfFlavorParams < KalturaFlavorParams
146
+ attr_accessor :flash_version
147
+ attr_accessor :poly2bitmap
148
+
149
+ def flash_version=(val)
150
+ @flash_version = val.to_i
151
+ end
152
+ def poly2bitmap=(val)
153
+ @poly2bitmap = to_b(val)
154
+ end
155
+ end
156
+
157
+ class KalturaDocumentEntryBaseFilter < KalturaBaseEntryFilter
158
+ attr_accessor :document_type_equal
159
+ attr_accessor :document_type_in
160
+ attr_accessor :asset_params_ids_match_or
161
+ attr_accessor :asset_params_ids_match_and
162
+
163
+ def document_type_equal=(val)
164
+ @document_type_equal = val.to_i
165
+ end
166
+ end
167
+
168
+ class KalturaDocumentFlavorParamsOutput < KalturaFlavorParamsOutput
169
+
170
+ end
171
+
172
+ class KalturaImageFlavorParamsOutput < KalturaFlavorParamsOutput
173
+ attr_accessor :density_width
174
+ attr_accessor :density_height
175
+ attr_accessor :size_width
176
+ attr_accessor :size_height
177
+ attr_accessor :depth
178
+
179
+ def density_width=(val)
180
+ @density_width = val.to_i
181
+ end
182
+ def density_height=(val)
183
+ @density_height = val.to_i
184
+ end
185
+ def size_width=(val)
186
+ @size_width = val.to_i
187
+ end
188
+ def size_height=(val)
189
+ @size_height = val.to_i
190
+ end
191
+ def depth=(val)
192
+ @depth = val.to_i
193
+ end
194
+ end
195
+
196
+ class KalturaPdfFlavorParamsOutput < KalturaFlavorParamsOutput
197
+ attr_accessor :readonly
198
+
199
+ def readonly=(val)
200
+ @readonly = to_b(val)
201
+ end
202
+ end
203
+
204
+ class KalturaSwfFlavorParamsOutput < KalturaFlavorParamsOutput
205
+ attr_accessor :flash_version
206
+ attr_accessor :poly2bitmap
207
+
208
+ def flash_version=(val)
209
+ @flash_version = val.to_i
210
+ end
211
+ def poly2bitmap=(val)
212
+ @poly2bitmap = to_b(val)
213
+ end
214
+ end
215
+
216
+ class KalturaDocumentEntryFilter < KalturaDocumentEntryBaseFilter
217
+
218
+ end
219
+
220
+ class KalturaDocumentFlavorParamsBaseFilter < KalturaFlavorParamsFilter
221
+
222
+ end
223
+
224
+ class KalturaImageFlavorParamsBaseFilter < KalturaFlavorParamsFilter
225
+
226
+ end
227
+
228
+ class KalturaPdfFlavorParamsBaseFilter < KalturaFlavorParamsFilter
229
+
230
+ end
231
+
232
+ class KalturaSwfFlavorParamsBaseFilter < KalturaFlavorParamsFilter
233
+
234
+ end
235
+
236
+ class KalturaDocumentFlavorParamsFilter < KalturaDocumentFlavorParamsBaseFilter
237
+
238
+ end
239
+
240
+ class KalturaImageFlavorParamsFilter < KalturaImageFlavorParamsBaseFilter
241
+
242
+ end
243
+
244
+ class KalturaPdfFlavorParamsFilter < KalturaPdfFlavorParamsBaseFilter
245
+
246
+ end
247
+
248
+ class KalturaSwfFlavorParamsFilter < KalturaSwfFlavorParamsBaseFilter
249
+
250
+ end
251
+
252
+ class KalturaDocumentFlavorParamsOutputBaseFilter < KalturaFlavorParamsOutputFilter
253
+
254
+ end
255
+
256
+ class KalturaImageFlavorParamsOutputBaseFilter < KalturaFlavorParamsOutputFilter
257
+
258
+ end
259
+
260
+ class KalturaPdfFlavorParamsOutputBaseFilter < KalturaFlavorParamsOutputFilter
261
+
262
+ end
263
+
264
+ class KalturaSwfFlavorParamsOutputBaseFilter < KalturaFlavorParamsOutputFilter
265
+
266
+ end
267
+
268
+ class KalturaDocumentFlavorParamsOutputFilter < KalturaDocumentFlavorParamsOutputBaseFilter
269
+
270
+ end
271
+
272
+ class KalturaImageFlavorParamsOutputFilter < KalturaImageFlavorParamsOutputBaseFilter
273
+
274
+ end
275
+
276
+ class KalturaPdfFlavorParamsOutputFilter < KalturaPdfFlavorParamsOutputBaseFilter
277
+
278
+ end
279
+
280
+ class KalturaSwfFlavorParamsOutputFilter < KalturaSwfFlavorParamsOutputBaseFilter
281
+
282
+ end
283
+
284
+
285
+ # Document service lets you upload and manage document files
286
+ #
287
+ class KalturaDocumentsService < KalturaServiceBase
288
+ def initialize(client)
289
+ super(client)
290
+ end
291
+
292
+ # Add new document entry after the specific document file was uploaded and the upload token id exists
293
+ #
294
+ def add_from_uploaded_file(document_entry, upload_token_id)
295
+ kparams = {}
296
+ # Document entry metadata
297
+ client.add_param(kparams, 'documentEntry', document_entry);
298
+ # Upload token id
299
+ client.add_param(kparams, 'uploadTokenId', upload_token_id);
300
+ client.queue_service_action_call('document_documents', 'addFromUploadedFile', kparams);
301
+ if (client.is_multirequest)
302
+ return nil;
303
+ end
304
+ return client.do_queue();
305
+ end
306
+
307
+ # Copy entry into new entry
308
+ #
309
+ def add_from_entry(source_entry_id, document_entry=KalturaNotImplemented, source_flavor_params_id=KalturaNotImplemented)
310
+ kparams = {}
311
+ # Document entry id to copy from
312
+ client.add_param(kparams, 'sourceEntryId', source_entry_id);
313
+ # Document entry metadata
314
+ client.add_param(kparams, 'documentEntry', document_entry);
315
+ # The flavor to be used as the new entry source, source flavor will be used if not specified
316
+ client.add_param(kparams, 'sourceFlavorParamsId', source_flavor_params_id);
317
+ client.queue_service_action_call('document_documents', 'addFromEntry', kparams);
318
+ if (client.is_multirequest)
319
+ return nil;
320
+ end
321
+ return client.do_queue();
322
+ end
323
+
324
+ # Copy flavor asset into new entry
325
+ #
326
+ def add_from_flavor_asset(source_flavor_asset_id, document_entry=KalturaNotImplemented)
327
+ kparams = {}
328
+ # Flavor asset id to be used as the new entry source
329
+ client.add_param(kparams, 'sourceFlavorAssetId', source_flavor_asset_id);
330
+ # Document entry metadata
331
+ client.add_param(kparams, 'documentEntry', document_entry);
332
+ client.queue_service_action_call('document_documents', 'addFromFlavorAsset', kparams);
333
+ if (client.is_multirequest)
334
+ return nil;
335
+ end
336
+ return client.do_queue();
337
+ end
338
+
339
+ # Convert entry
340
+ #
341
+ def convert(entry_id, conversion_profile_id=KalturaNotImplemented, dynamic_conversion_attributes=KalturaNotImplemented)
342
+ kparams = {}
343
+ # Document entry id
344
+ client.add_param(kparams, 'entryId', entry_id);
345
+ client.add_param(kparams, 'conversionProfileId', conversion_profile_id);
346
+ dynamicConversionAttributes.each do |obj|
347
+ client.add_param(kparams, 'dynamicConversionAttributes', obj);
348
+ end
349
+ client.queue_service_action_call('document_documents', 'convert', kparams);
350
+ if (client.is_multirequest)
351
+ return nil;
352
+ end
353
+ return client.do_queue();
354
+ end
355
+
356
+ # Get document entry by ID.
357
+ #
358
+ def get(entry_id, version=-1)
359
+ kparams = {}
360
+ # Document entry id
361
+ client.add_param(kparams, 'entryId', entry_id);
362
+ # Desired version of the data
363
+ client.add_param(kparams, 'version', version);
364
+ client.queue_service_action_call('document_documents', 'get', kparams);
365
+ if (client.is_multirequest)
366
+ return nil;
367
+ end
368
+ return client.do_queue();
369
+ end
370
+
371
+ # Update document entry. Only the properties that were set will be updated.
372
+ #
373
+ def update(entry_id, document_entry)
374
+ kparams = {}
375
+ # Document entry id to update
376
+ client.add_param(kparams, 'entryId', entry_id);
377
+ # Document entry metadata to update
378
+ client.add_param(kparams, 'documentEntry', document_entry);
379
+ client.queue_service_action_call('document_documents', 'update', kparams);
380
+ if (client.is_multirequest)
381
+ return nil;
382
+ end
383
+ return client.do_queue();
384
+ end
385
+
386
+ # Delete a document entry.
387
+ #
388
+ def delete(entry_id)
389
+ kparams = {}
390
+ # Document entry id to delete
391
+ client.add_param(kparams, 'entryId', entry_id);
392
+ client.queue_service_action_call('document_documents', 'delete', kparams);
393
+ if (client.is_multirequest)
394
+ return nil;
395
+ end
396
+ return client.do_queue();
397
+ end
398
+
399
+ # List document entries by filter with paging support.
400
+ #
401
+ def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
402
+ kparams = {}
403
+ # Document entry filter
404
+ client.add_param(kparams, 'filter', filter);
405
+ # Pager
406
+ client.add_param(kparams, 'pager', pager);
407
+ client.queue_service_action_call('document_documents', 'list', kparams);
408
+ if (client.is_multirequest)
409
+ return nil;
410
+ end
411
+ return client.do_queue();
412
+ end
413
+
414
+ # Upload a document file to Kaltura, then the file can be used to create a document entry.
415
+ #
416
+ def upload(file_data)
417
+ kparams = {}
418
+ # The file data
419
+ client.add_param(kparams, 'fileData', file_data);
420
+ client.queue_service_action_call('document_documents', 'upload', kparams);
421
+ if (client.is_multirequest)
422
+ return nil;
423
+ end
424
+ return client.do_queue();
425
+ end
426
+
427
+ # This will queue a batch job for converting the document file to swf
428
+ # Returns the URL where the new swf will be available
429
+ #
430
+ def convert_ppt_to_swf(entry_id)
431
+ kparams = {}
432
+ client.add_param(kparams, 'entryId', entry_id);
433
+ client.queue_service_action_call('document_documents', 'convertPptToSwf', kparams);
434
+ if (client.is_multirequest)
435
+ return nil;
436
+ end
437
+ return client.do_queue();
438
+ end
439
+
440
+ # Serves the file content
441
+ #
442
+ def serve(entry_id, flavor_asset_id=KalturaNotImplemented, force_proxy=false)
443
+ kparams = {}
444
+ # Document entry id
445
+ client.add_param(kparams, 'entryId', entry_id);
446
+ # Flavor asset id
447
+ client.add_param(kparams, 'flavorAssetId', flavor_asset_id);
448
+ # force to get the content without redirect
449
+ client.add_param(kparams, 'forceProxy', force_proxy);
450
+ client.queue_service_action_call('document_documents', 'serve', kparams);
451
+ return client.get_serve_url();
452
+ end
453
+
454
+ # Serves the file content
455
+ #
456
+ def serve_by_flavor_params_id(entry_id, flavor_params_id=KalturaNotImplemented, force_proxy=false)
457
+ kparams = {}
458
+ # Document entry id
459
+ client.add_param(kparams, 'entryId', entry_id);
460
+ # Flavor params id
461
+ client.add_param(kparams, 'flavorParamsId', flavor_params_id);
462
+ # force to get the content without redirect
463
+ client.add_param(kparams, 'forceProxy', force_proxy);
464
+ client.queue_service_action_call('document_documents', 'serveByFlavorParamsId', kparams);
465
+ return client.get_serve_url();
466
+ end
467
+
468
+ # Replace content associated with the given document entry.
469
+ #
470
+ def update_content(entry_id, resource, conversion_profile_id=KalturaNotImplemented)
471
+ kparams = {}
472
+ # document entry id to update
473
+ client.add_param(kparams, 'entryId', entry_id);
474
+ # Resource to be used to replace entry doc content
475
+ client.add_param(kparams, 'resource', resource);
476
+ # The conversion profile id to be used on the entry
477
+ client.add_param(kparams, 'conversionProfileId', conversion_profile_id);
478
+ client.queue_service_action_call('document_documents', 'updateContent', kparams);
479
+ if (client.is_multirequest)
480
+ return nil;
481
+ end
482
+ return client.do_queue();
483
+ end
484
+
485
+ # Approves document replacement
486
+ #
487
+ def approve_replace(entry_id)
488
+ kparams = {}
489
+ # document entry id to replace
490
+ client.add_param(kparams, 'entryId', entry_id);
491
+ client.queue_service_action_call('document_documents', 'approveReplace', kparams);
492
+ if (client.is_multirequest)
493
+ return nil;
494
+ end
495
+ return client.do_queue();
496
+ end
497
+
498
+ # Cancels document replacement
499
+ #
500
+ def cancel_replace(entry_id)
501
+ kparams = {}
502
+ # Document entry id to cancel
503
+ client.add_param(kparams, 'entryId', entry_id);
504
+ client.queue_service_action_call('document_documents', 'cancelReplace', kparams);
505
+ if (client.is_multirequest)
506
+ return nil;
507
+ end
508
+ return client.do_queue();
509
+ end
510
+ end
511
+
512
+ class KalturaClient < KalturaClientBase
513
+ attr_reader :documents_service
514
+ def documents_service
515
+ if (@documents_service == nil)
516
+ @documents_service = KalturaDocumentsService.new(self)
517
+ end
518
+ return @documents_service
519
+ end
520
+ end
521
+
522
+ end