kaltura-client 1.2

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.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/README +21 -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 +15649 -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 +110 -0
  11. data/lib/kaltura_plugins/kaltura_annotation_client_plugin.rb +239 -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 +116 -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 +58 -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 +99 -0
  22. data/lib/kaltura_plugins/kaltura_content_distribution_client_plugin.rb +1725 -0
  23. data/lib/kaltura_plugins/kaltura_cue_point_client_plugin.rb +312 -0
  24. data/lib/kaltura_plugins/kaltura_document_client_plugin.rb +522 -0
  25. data/lib/kaltura_plugins/kaltura_drm_client_plugin.rb +401 -0
  26. data/lib/kaltura_plugins/kaltura_drop_folder_client_plugin.rb +827 -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 +273 -0
  29. data/lib/kaltura_plugins/kaltura_event_cue_point_client_plugin.rb +67 -0
  30. data/lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb +415 -0
  31. data/lib/kaltura_plugins/kaltura_external_media_client_plugin.rb +203 -0
  32. data/lib/kaltura_plugins/kaltura_file_sync_client_plugin.rb +157 -0
  33. data/lib/kaltura_plugins/kaltura_http_notification_client_plugin.rb +309 -0
  34. data/lib/kaltura_plugins/kaltura_kontiki_client_plugin.rb +72 -0
  35. data/lib/kaltura_plugins/kaltura_like_client_plugin.rb +82 -0
  36. data/lib/kaltura_plugins/kaltura_metadata_client_plugin.rb +785 -0
  37. data/lib/kaltura_plugins/kaltura_multi_centers_client_plugin.rb +45 -0
  38. data/lib/kaltura_plugins/kaltura_play_ready_client_plugin.rb +347 -0
  39. data/lib/kaltura_plugins/kaltura_scheduled_task_client_plugin.rb +347 -0
  40. data/lib/kaltura_plugins/kaltura_scheduled_task_event_notification_client_plugin.rb +45 -0
  41. data/lib/kaltura_plugins/kaltura_scheduled_task_metadata_client_plugin.rb +51 -0
  42. data/lib/kaltura_plugins/kaltura_short_link_client_plugin.rb +231 -0
  43. data/lib/kaltura_plugins/kaltura_tag_search_client_plugin.rb +145 -0
  44. data/lib/kaltura_plugins/kaltura_thumb_cue_point_client_plugin.rb +105 -0
  45. data/lib/kaltura_plugins/kaltura_var_console_client_plugin.rb +238 -0
  46. data/lib/kaltura_plugins/kaltura_velocix_client_plugin.rb +40 -0
  47. data/lib/kaltura_plugins/kaltura_virus_scan_client_plugin.rb +263 -0
  48. data/lib/kaltura_plugins/kaltura_webex_drop_folder_client_plugin.rb +111 -0
  49. data/lib/kaltura_plugins/kaltura_widevine_client_plugin.rb +195 -0
  50. data/test/access_control_service_test.rb +75 -0
  51. data/test/base_entry_service_test.rb +267 -0
  52. data/test/configuration_test.rb +178 -0
  53. data/test/cue_point_service_test.rb +67 -0
  54. data/test/data_service_test.rb +76 -0
  55. data/test/document_service_test.rb +41 -0
  56. data/test/media/test.mov +0 -0
  57. data/test/media/test.pdf +0 -0
  58. data/test/media/test.png +0 -0
  59. data/test/media/test.swf +0 -0
  60. data/test/media/test.wmv +0 -0
  61. data/test/media_service_test.rb +294 -0
  62. data/test/metadata_profile_service_test.rb +63 -0
  63. data/test/test_helper.rb +59 -0
  64. metadata +132 -0
@@ -0,0 +1,312 @@
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
+ HANDLED = 3
36
+ end
37
+
38
+ class KalturaThumbCuePointSubType
39
+ SLIDE = 1
40
+ CHAPTER = 2
41
+ end
42
+
43
+ class KalturaCuePointOrderBy
44
+ CREATED_AT_ASC = "+createdAt"
45
+ PARTNER_SORT_VALUE_ASC = "+partnerSortValue"
46
+ START_TIME_ASC = "+startTime"
47
+ TRIGGERED_AT_ASC = "+triggeredAt"
48
+ UPDATED_AT_ASC = "+updatedAt"
49
+ CREATED_AT_DESC = "-createdAt"
50
+ PARTNER_SORT_VALUE_DESC = "-partnerSortValue"
51
+ START_TIME_DESC = "-startTime"
52
+ TRIGGERED_AT_DESC = "-triggeredAt"
53
+ UPDATED_AT_DESC = "-updatedAt"
54
+ end
55
+
56
+ class KalturaCuePointType
57
+ AD = "adCuePoint.Ad"
58
+ ANNOTATION = "annotation.Annotation"
59
+ CODE = "codeCuePoint.Code"
60
+ EVENT = "eventCuePoint.Event"
61
+ THUMB = "thumbCuePoint.Thumb"
62
+ end
63
+
64
+ class KalturaCuePoint < KalturaObjectBase
65
+ attr_accessor :id
66
+ attr_accessor :cue_point_type
67
+ attr_accessor :status
68
+ attr_accessor :entry_id
69
+ attr_accessor :partner_id
70
+ attr_accessor :created_at
71
+ attr_accessor :updated_at
72
+ attr_accessor :triggered_at
73
+ attr_accessor :tags
74
+ # Start time in milliseconds
75
+ #
76
+ attr_accessor :start_time
77
+ attr_accessor :user_id
78
+ attr_accessor :partner_data
79
+ attr_accessor :partner_sort_value
80
+ attr_accessor :force_stop
81
+ attr_accessor :thumb_offset
82
+ attr_accessor :system_name
83
+
84
+ def status=(val)
85
+ @status = val.to_i
86
+ end
87
+ def partner_id=(val)
88
+ @partner_id = val.to_i
89
+ end
90
+ def created_at=(val)
91
+ @created_at = val.to_i
92
+ end
93
+ def updated_at=(val)
94
+ @updated_at = val.to_i
95
+ end
96
+ def triggered_at=(val)
97
+ @triggered_at = val.to_i
98
+ end
99
+ def start_time=(val)
100
+ @start_time = val.to_i
101
+ end
102
+ def partner_sort_value=(val)
103
+ @partner_sort_value = val.to_i
104
+ end
105
+ def force_stop=(val)
106
+ @force_stop = val.to_i
107
+ end
108
+ def thumb_offset=(val)
109
+ @thumb_offset = val.to_i
110
+ end
111
+ end
112
+
113
+ class KalturaCuePointListResponse < KalturaObjectBase
114
+ attr_accessor :objects
115
+ attr_accessor :total_count
116
+
117
+ def total_count=(val)
118
+ @total_count = val.to_i
119
+ end
120
+ end
121
+
122
+ class KalturaCuePointBaseFilter < KalturaFilter
123
+ attr_accessor :id_equal
124
+ attr_accessor :id_in
125
+ attr_accessor :cue_point_type_equal
126
+ attr_accessor :cue_point_type_in
127
+ attr_accessor :status_equal
128
+ attr_accessor :status_in
129
+ attr_accessor :entry_id_equal
130
+ attr_accessor :entry_id_in
131
+ attr_accessor :created_at_greater_than_or_equal
132
+ attr_accessor :created_at_less_than_or_equal
133
+ attr_accessor :updated_at_greater_than_or_equal
134
+ attr_accessor :updated_at_less_than_or_equal
135
+ attr_accessor :triggered_at_greater_than_or_equal
136
+ attr_accessor :triggered_at_less_than_or_equal
137
+ attr_accessor :tags_like
138
+ attr_accessor :tags_multi_like_or
139
+ attr_accessor :tags_multi_like_and
140
+ attr_accessor :start_time_greater_than_or_equal
141
+ attr_accessor :start_time_less_than_or_equal
142
+ attr_accessor :user_id_equal
143
+ attr_accessor :user_id_in
144
+ attr_accessor :partner_sort_value_equal
145
+ attr_accessor :partner_sort_value_in
146
+ attr_accessor :partner_sort_value_greater_than_or_equal
147
+ attr_accessor :partner_sort_value_less_than_or_equal
148
+ attr_accessor :force_stop_equal
149
+ attr_accessor :system_name_equal
150
+ attr_accessor :system_name_in
151
+
152
+ def status_equal=(val)
153
+ @status_equal = val.to_i
154
+ end
155
+ def created_at_greater_than_or_equal=(val)
156
+ @created_at_greater_than_or_equal = val.to_i
157
+ end
158
+ def created_at_less_than_or_equal=(val)
159
+ @created_at_less_than_or_equal = val.to_i
160
+ end
161
+ def updated_at_greater_than_or_equal=(val)
162
+ @updated_at_greater_than_or_equal = val.to_i
163
+ end
164
+ def updated_at_less_than_or_equal=(val)
165
+ @updated_at_less_than_or_equal = val.to_i
166
+ end
167
+ def triggered_at_greater_than_or_equal=(val)
168
+ @triggered_at_greater_than_or_equal = val.to_i
169
+ end
170
+ def triggered_at_less_than_or_equal=(val)
171
+ @triggered_at_less_than_or_equal = val.to_i
172
+ end
173
+ def start_time_greater_than_or_equal=(val)
174
+ @start_time_greater_than_or_equal = val.to_i
175
+ end
176
+ def start_time_less_than_or_equal=(val)
177
+ @start_time_less_than_or_equal = val.to_i
178
+ end
179
+ def partner_sort_value_equal=(val)
180
+ @partner_sort_value_equal = val.to_i
181
+ end
182
+ def partner_sort_value_greater_than_or_equal=(val)
183
+ @partner_sort_value_greater_than_or_equal = val.to_i
184
+ end
185
+ def partner_sort_value_less_than_or_equal=(val)
186
+ @partner_sort_value_less_than_or_equal = val.to_i
187
+ end
188
+ def force_stop_equal=(val)
189
+ @force_stop_equal = val.to_i
190
+ end
191
+ end
192
+
193
+ class KalturaCuePointFilter < KalturaCuePointBaseFilter
194
+
195
+ end
196
+
197
+
198
+ # Cue Point service
199
+ #
200
+ class KalturaCuePointService < KalturaServiceBase
201
+ def initialize(client)
202
+ super(client)
203
+ end
204
+
205
+ # Allows you to add an cue point object associated with an entry
206
+ #
207
+ def add(cue_point)
208
+ kparams = {}
209
+ client.add_param(kparams, 'cuePoint', cue_point);
210
+ client.queue_service_action_call('cuepoint_cuepoint', 'add', kparams);
211
+ if (client.is_multirequest)
212
+ return nil;
213
+ end
214
+ return client.do_queue();
215
+ end
216
+
217
+ # Allows you to add multiple cue points objects by uploading XML that contains multiple cue point definitions
218
+ #
219
+ def add_from_bulk(file_data)
220
+ kparams = {}
221
+ client.add_param(kparams, 'fileData', file_data);
222
+ client.queue_service_action_call('cuepoint_cuepoint', 'addFromBulk', kparams);
223
+ if (client.is_multirequest)
224
+ return nil;
225
+ end
226
+ return client.do_queue();
227
+ end
228
+
229
+ # Download multiple cue points objects as XML definitions
230
+ #
231
+ def serve_bulk(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', 'serveBulk', kparams);
236
+ return client.get_serve_url();
237
+ end
238
+
239
+ # Retrieve an CuePoint object by id
240
+ #
241
+ def get(id)
242
+ kparams = {}
243
+ client.add_param(kparams, 'id', id);
244
+ client.queue_service_action_call('cuepoint_cuepoint', 'get', kparams);
245
+ if (client.is_multirequest)
246
+ return nil;
247
+ end
248
+ return client.do_queue();
249
+ end
250
+
251
+ # List cue point objects by filter and pager
252
+ #
253
+ def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
254
+ kparams = {}
255
+ client.add_param(kparams, 'filter', filter);
256
+ client.add_param(kparams, 'pager', pager);
257
+ client.queue_service_action_call('cuepoint_cuepoint', 'list', kparams);
258
+ if (client.is_multirequest)
259
+ return nil;
260
+ end
261
+ return client.do_queue();
262
+ end
263
+
264
+ # count cue point objects by filter
265
+ #
266
+ def count(filter=KalturaNotImplemented)
267
+ kparams = {}
268
+ client.add_param(kparams, 'filter', filter);
269
+ client.queue_service_action_call('cuepoint_cuepoint', 'count', kparams);
270
+ if (client.is_multirequest)
271
+ return nil;
272
+ end
273
+ return client.do_queue();
274
+ end
275
+
276
+ # Update cue point by id
277
+ #
278
+ def update(id, cue_point)
279
+ kparams = {}
280
+ client.add_param(kparams, 'id', id);
281
+ client.add_param(kparams, 'cuePoint', cue_point);
282
+ client.queue_service_action_call('cuepoint_cuepoint', 'update', kparams);
283
+ if (client.is_multirequest)
284
+ return nil;
285
+ end
286
+ return client.do_queue();
287
+ end
288
+
289
+ # delete cue point by id, and delete all children cue points
290
+ #
291
+ def delete(id)
292
+ kparams = {}
293
+ client.add_param(kparams, 'id', id);
294
+ client.queue_service_action_call('cuepoint_cuepoint', 'delete', kparams);
295
+ if (client.is_multirequest)
296
+ return nil;
297
+ end
298
+ return client.do_queue();
299
+ end
300
+ end
301
+
302
+ class KalturaClient < KalturaClientBase
303
+ attr_reader :cue_point_service
304
+ def cue_point_service
305
+ if (@cue_point_service == nil)
306
+ @cue_point_service = KalturaCuePointService.new(self)
307
+ end
308
+ return @cue_point_service
309
+ end
310
+ end
311
+
312
+ 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