kaltura_api 1.0
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.
- checksums.yaml +7 -0
- data/README +40 -0
- data/Rakefile +19 -0
- data/kaltura_api.yml +7 -0
- data/lib/kaltura_api.rb +31 -0
- data/lib/kaltura_client.rb +14450 -0
- data/lib/kaltura_client_base.rb +432 -0
- data/lib/kaltura_plugins/kaltura_abc_screeners_watermark_access_control_client_plugin.rb +37 -0
- data/lib/kaltura_plugins/kaltura_ad_cue_point_client_plugin.rb +108 -0
- data/lib/kaltura_plugins/kaltura_annotation_client_plugin.rb +237 -0
- data/lib/kaltura_plugins/kaltura_aspera_client_plugin.rb +61 -0
- data/lib/kaltura_plugins/kaltura_attachment_client_plugin.rb +227 -0
- data/lib/kaltura_plugins/kaltura_audit_client_plugin.rb +349 -0
- data/lib/kaltura_plugins/kaltura_bulk_upload_client_plugin.rb +109 -0
- data/lib/kaltura_plugins/kaltura_bulk_upload_csv_client_plugin.rb +55 -0
- data/lib/kaltura_plugins/kaltura_bulk_upload_filter_client_plugin.rb +46 -0
- data/lib/kaltura_plugins/kaltura_bulk_upload_xml_client_plugin.rb +40 -0
- data/lib/kaltura_plugins/kaltura_caption_client_plugin.rb +406 -0
- data/lib/kaltura_plugins/kaltura_caption_search_client_plugin.rb +138 -0
- data/lib/kaltura_plugins/kaltura_code_cue_point_client_plugin.rb +97 -0
- data/lib/kaltura_plugins/kaltura_content_distribution_client_plugin.rb +1717 -0
- data/lib/kaltura_plugins/kaltura_cue_point_client_plugin.rb +290 -0
- data/lib/kaltura_plugins/kaltura_document_client_plugin.rb +522 -0
- data/lib/kaltura_plugins/kaltura_drm_client_plugin.rb +204 -0
- data/lib/kaltura_plugins/kaltura_drop_folder_client_plugin.rb +810 -0
- data/lib/kaltura_plugins/kaltura_drop_folder_xml_bulk_upload_client_plugin.rb +39 -0
- data/lib/kaltura_plugins/kaltura_email_notification_client_plugin.rb +276 -0
- data/lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb +405 -0
- data/lib/kaltura_plugins/kaltura_external_media_client_plugin.rb +203 -0
- data/lib/kaltura_plugins/kaltura_file_sync_client_plugin.rb +151 -0
- data/lib/kaltura_plugins/kaltura_http_notification_client_plugin.rb +309 -0
- data/lib/kaltura_plugins/kaltura_kontiki_client_plugin.rb +72 -0
- data/lib/kaltura_plugins/kaltura_like_client_plugin.rb +82 -0
- data/lib/kaltura_plugins/kaltura_metadata_client_plugin.rb +788 -0
- data/lib/kaltura_plugins/kaltura_multi_centers_client_plugin.rb +45 -0
- data/lib/kaltura_plugins/kaltura_short_link_client_plugin.rb +231 -0
- data/lib/kaltura_plugins/kaltura_tag_search_client_plugin.rb +145 -0
- data/lib/kaltura_plugins/kaltura_var_console_client_plugin.rb +238 -0
- data/lib/kaltura_plugins/kaltura_velocix_client_plugin.rb +40 -0
- data/lib/kaltura_plugins/kaltura_virus_scan_client_plugin.rb +263 -0
- data/lib/kaltura_plugins/kaltura_webex_drop_folder_client_plugin.rb +121 -0
- data/lib/kaltura_plugins/kaltura_widevine_client_plugin.rb +195 -0
- data/test/access_control_service_test.rb +75 -0
- data/test/base_entry_service_test.rb +267 -0
- data/test/configuration_test.rb +178 -0
- data/test/cue_point_service_test.rb +67 -0
- data/test/data_service_test.rb +76 -0
- data/test/document_service_test.rb +41 -0
- data/test/media/test.mov +0 -0
- data/test/media/test.pdf +0 -0
- data/test/media/test.png +0 -0
- data/test/media/test.swf +0 -0
- data/test/media/test.wmv +0 -0
- data/test/media_service_test.rb +294 -0
- data/test/metadata_profile_service_test.rb +63 -0
- data/test/test_helper.rb +59 -0
- metadata +126 -0
@@ -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 KalturaApi
|
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
|
@@ -0,0 +1,204 @@
|
|
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 KalturaApi
|
31
|
+
|
32
|
+
class KalturaDrmProfileStatus
|
33
|
+
ACTIVE = 1
|
34
|
+
DELETED = 2
|
35
|
+
end
|
36
|
+
|
37
|
+
class KalturaDrmProfileOrderBy
|
38
|
+
ID_ASC = "+id"
|
39
|
+
NAME_ASC = "+name"
|
40
|
+
ID_DESC = "-id"
|
41
|
+
NAME_DESC = "-name"
|
42
|
+
end
|
43
|
+
|
44
|
+
class KalturaDrmProviderType
|
45
|
+
WIDEVINE = "widevine.WIDEVINE"
|
46
|
+
end
|
47
|
+
|
48
|
+
class KalturaDrmProfile < KalturaObjectBase
|
49
|
+
attr_accessor :id
|
50
|
+
attr_accessor :partner_id
|
51
|
+
attr_accessor :name
|
52
|
+
attr_accessor :description
|
53
|
+
attr_accessor :provider
|
54
|
+
attr_accessor :status
|
55
|
+
attr_accessor :license_server_url
|
56
|
+
attr_accessor :default_policy
|
57
|
+
attr_accessor :created_at
|
58
|
+
attr_accessor :updated_at
|
59
|
+
|
60
|
+
def id=(val)
|
61
|
+
@id = val.to_i
|
62
|
+
end
|
63
|
+
def partner_id=(val)
|
64
|
+
@partner_id = val.to_i
|
65
|
+
end
|
66
|
+
def status=(val)
|
67
|
+
@status = val.to_i
|
68
|
+
end
|
69
|
+
def created_at=(val)
|
70
|
+
@created_at = val.to_i
|
71
|
+
end
|
72
|
+
def updated_at=(val)
|
73
|
+
@updated_at = val.to_i
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
class KalturaDrmProfileListResponse < KalturaObjectBase
|
78
|
+
attr_accessor :objects
|
79
|
+
attr_accessor :total_count
|
80
|
+
|
81
|
+
def total_count=(val)
|
82
|
+
@total_count = val.to_i
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
class KalturaDrmProfileBaseFilter < KalturaFilter
|
87
|
+
attr_accessor :id_equal
|
88
|
+
attr_accessor :id_in
|
89
|
+
attr_accessor :partner_id_equal
|
90
|
+
attr_accessor :partner_id_in
|
91
|
+
attr_accessor :name_like
|
92
|
+
attr_accessor :provider_equal
|
93
|
+
attr_accessor :provider_in
|
94
|
+
attr_accessor :status_equal
|
95
|
+
attr_accessor :status_in
|
96
|
+
|
97
|
+
def id_equal=(val)
|
98
|
+
@id_equal = val.to_i
|
99
|
+
end
|
100
|
+
def partner_id_equal=(val)
|
101
|
+
@partner_id_equal = val.to_i
|
102
|
+
end
|
103
|
+
def status_equal=(val)
|
104
|
+
@status_equal = val.to_i
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
class KalturaDrmProfileFilter < KalturaDrmProfileBaseFilter
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
|
113
|
+
class KalturaDrmProfileService < KalturaServiceBase
|
114
|
+
def initialize(client)
|
115
|
+
super(client)
|
116
|
+
end
|
117
|
+
|
118
|
+
# Allows you to add a new DrmProfile object
|
119
|
+
#
|
120
|
+
def add(drm_profile)
|
121
|
+
kparams = {}
|
122
|
+
client.add_param(kparams, 'drmProfile', drm_profile);
|
123
|
+
client.queue_service_action_call('drm_drmprofile', 'add', kparams);
|
124
|
+
if (client.is_multirequest)
|
125
|
+
return nil;
|
126
|
+
end
|
127
|
+
return client.do_queue();
|
128
|
+
end
|
129
|
+
|
130
|
+
# Retrieve a KalturaDrmProfile object by ID
|
131
|
+
#
|
132
|
+
def get(drm_profile_id)
|
133
|
+
kparams = {}
|
134
|
+
client.add_param(kparams, 'drmProfileId', drm_profile_id);
|
135
|
+
client.queue_service_action_call('drm_drmprofile', 'get', kparams);
|
136
|
+
if (client.is_multirequest)
|
137
|
+
return nil;
|
138
|
+
end
|
139
|
+
return client.do_queue();
|
140
|
+
end
|
141
|
+
|
142
|
+
# Update an existing KalturaDrmProfile object
|
143
|
+
#
|
144
|
+
def update(drm_profile_id, drm_profile)
|
145
|
+
kparams = {}
|
146
|
+
client.add_param(kparams, 'drmProfileId', drm_profile_id);
|
147
|
+
# Id
|
148
|
+
client.add_param(kparams, 'drmProfile', drm_profile);
|
149
|
+
client.queue_service_action_call('drm_drmprofile', 'update', kparams);
|
150
|
+
if (client.is_multirequest)
|
151
|
+
return nil;
|
152
|
+
end
|
153
|
+
return client.do_queue();
|
154
|
+
end
|
155
|
+
|
156
|
+
# Mark the KalturaDrmProfile object as deleted
|
157
|
+
#
|
158
|
+
def delete(drm_profile_id)
|
159
|
+
kparams = {}
|
160
|
+
client.add_param(kparams, 'drmProfileId', drm_profile_id);
|
161
|
+
client.queue_service_action_call('drm_drmprofile', 'delete', kparams);
|
162
|
+
if (client.is_multirequest)
|
163
|
+
return nil;
|
164
|
+
end
|
165
|
+
return client.do_queue();
|
166
|
+
end
|
167
|
+
|
168
|
+
# List KalturaDrmProfile objects
|
169
|
+
#
|
170
|
+
def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
|
171
|
+
kparams = {}
|
172
|
+
client.add_param(kparams, 'filter', filter);
|
173
|
+
client.add_param(kparams, 'pager', pager);
|
174
|
+
client.queue_service_action_call('drm_drmprofile', 'list', kparams);
|
175
|
+
if (client.is_multirequest)
|
176
|
+
return nil;
|
177
|
+
end
|
178
|
+
return client.do_queue();
|
179
|
+
end
|
180
|
+
|
181
|
+
# Retrieve a KalturaDrmProfile object by provider, if no specific profile defined return default profile
|
182
|
+
#
|
183
|
+
def get_by_provider(provider)
|
184
|
+
kparams = {}
|
185
|
+
client.add_param(kparams, 'provider', provider);
|
186
|
+
client.queue_service_action_call('drm_drmprofile', 'getByProvider', kparams);
|
187
|
+
if (client.is_multirequest)
|
188
|
+
return nil;
|
189
|
+
end
|
190
|
+
return client.do_queue();
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
class KalturaClient < KalturaClientBase
|
195
|
+
attr_reader :drm_profile_service
|
196
|
+
def drm_profile_service
|
197
|
+
if (@drm_profile_service == nil)
|
198
|
+
@drm_profile_service = KalturaDrmProfileService.new(self)
|
199
|
+
end
|
200
|
+
return @drm_profile_service
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
end
|