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,72 @@
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 KalturaKontikiStorageProfileOrderBy
33
+ CREATED_AT_ASC = "+createdAt"
34
+ UPDATED_AT_ASC = "+updatedAt"
35
+ CREATED_AT_DESC = "-createdAt"
36
+ UPDATED_AT_DESC = "-updatedAt"
37
+ end
38
+
39
+ class KalturaKontikiStorageProfile < KalturaStorageProfile
40
+ attr_accessor :service_token
41
+
42
+ end
43
+
44
+ class KalturaKontikiStorageDeleteJobData < KalturaStorageDeleteJobData
45
+ # Unique Kontiki MOID for the content uploaded to Kontiki
46
+ #
47
+ attr_accessor :content_moid
48
+ attr_accessor :service_token
49
+
50
+ end
51
+
52
+ class KalturaKontikiStorageExportJobData < KalturaStorageExportJobData
53
+ # Holds the id of the exported asset
54
+ #
55
+ attr_accessor :flavor_asset_id
56
+ # Unique Kontiki MOID for the content uploaded to Kontiki
57
+ #
58
+ attr_accessor :content_moid
59
+ attr_accessor :service_token
60
+
61
+ end
62
+
63
+ class KalturaKontikiStorageProfileBaseFilter < KalturaStorageProfileFilter
64
+
65
+ end
66
+
67
+ class KalturaKontikiStorageProfileFilter < KalturaKontikiStorageProfileBaseFilter
68
+
69
+ end
70
+
71
+
72
+ end
@@ -0,0 +1,82 @@
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
+
33
+ # Allows user to 'like' or 'unlike' and entry
34
+ #
35
+ class KalturaLikeService < KalturaServiceBase
36
+ def initialize(client)
37
+ super(client)
38
+ end
39
+
40
+ def like(entry_id)
41
+ kparams = {}
42
+ client.add_param(kparams, 'entryId', entry_id);
43
+ client.queue_service_action_call('like_like', 'like', kparams);
44
+ if (client.is_multirequest)
45
+ return nil;
46
+ end
47
+ return client.do_queue();
48
+ end
49
+
50
+ def unlike(entry_id)
51
+ kparams = {}
52
+ client.add_param(kparams, 'entryId', entry_id);
53
+ client.queue_service_action_call('like_like', 'unlike', kparams);
54
+ if (client.is_multirequest)
55
+ return nil;
56
+ end
57
+ return client.do_queue();
58
+ end
59
+
60
+ def check_like_exists(entry_id, user_id=KalturaNotImplemented)
61
+ kparams = {}
62
+ client.add_param(kparams, 'entryId', entry_id);
63
+ client.add_param(kparams, 'userId', user_id);
64
+ client.queue_service_action_call('like_like', 'checkLikeExists', kparams);
65
+ if (client.is_multirequest)
66
+ return nil;
67
+ end
68
+ return client.do_queue();
69
+ end
70
+ end
71
+
72
+ class KalturaClient < KalturaClientBase
73
+ attr_reader :like_service
74
+ def like_service
75
+ if (@like_service == nil)
76
+ @like_service = KalturaLikeService.new(self)
77
+ end
78
+ return @like_service
79
+ end
80
+ end
81
+
82
+ end
@@ -0,0 +1,785 @@
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 KalturaMetadataProfileCreateMode
33
+ API = 1
34
+ KMC = 2
35
+ APP = 3
36
+ end
37
+
38
+ class KalturaMetadataProfileStatus
39
+ ACTIVE = 1
40
+ DEPRECATED = 2
41
+ TRANSFORMING = 3
42
+ end
43
+
44
+ class KalturaMetadataStatus
45
+ VALID = 1
46
+ INVALID = 2
47
+ DELETED = 3
48
+ end
49
+
50
+ class KalturaMetadataObjectType
51
+ AD_CUE_POINT = "adCuePointMetadata.AdCuePoint"
52
+ ANNOTATION = "annotationMetadata.Annotation"
53
+ CODE_CUE_POINT = "codeCuePointMetadata.CodeCuePoint"
54
+ THUMB_CUE_POINT = "thumbCuePointMetadata.thumbCuePoint"
55
+ ENTRY = "1"
56
+ CATEGORY = "2"
57
+ USER = "3"
58
+ PARTNER = "4"
59
+ end
60
+
61
+ class KalturaMetadataOrderBy
62
+ CREATED_AT_ASC = "+createdAt"
63
+ METADATA_PROFILE_VERSION_ASC = "+metadataProfileVersion"
64
+ UPDATED_AT_ASC = "+updatedAt"
65
+ VERSION_ASC = "+version"
66
+ CREATED_AT_DESC = "-createdAt"
67
+ METADATA_PROFILE_VERSION_DESC = "-metadataProfileVersion"
68
+ UPDATED_AT_DESC = "-updatedAt"
69
+ VERSION_DESC = "-version"
70
+ end
71
+
72
+ class KalturaMetadataProfileOrderBy
73
+ CREATED_AT_ASC = "+createdAt"
74
+ UPDATED_AT_ASC = "+updatedAt"
75
+ CREATED_AT_DESC = "-createdAt"
76
+ UPDATED_AT_DESC = "-updatedAt"
77
+ end
78
+
79
+ class KalturaMetadata < KalturaObjectBase
80
+ attr_accessor :id
81
+ attr_accessor :partner_id
82
+ attr_accessor :metadata_profile_id
83
+ attr_accessor :metadata_profile_version
84
+ attr_accessor :metadata_object_type
85
+ attr_accessor :object_id
86
+ attr_accessor :version
87
+ attr_accessor :created_at
88
+ attr_accessor :updated_at
89
+ attr_accessor :status
90
+ attr_accessor :xml
91
+
92
+ def id=(val)
93
+ @id = val.to_i
94
+ end
95
+ def partner_id=(val)
96
+ @partner_id = val.to_i
97
+ end
98
+ def metadata_profile_id=(val)
99
+ @metadata_profile_id = val.to_i
100
+ end
101
+ def metadata_profile_version=(val)
102
+ @metadata_profile_version = val.to_i
103
+ end
104
+ def version=(val)
105
+ @version = val.to_i
106
+ end
107
+ def created_at=(val)
108
+ @created_at = val.to_i
109
+ end
110
+ def updated_at=(val)
111
+ @updated_at = val.to_i
112
+ end
113
+ def status=(val)
114
+ @status = val.to_i
115
+ end
116
+ end
117
+
118
+ class KalturaMetadataListResponse < KalturaObjectBase
119
+ attr_accessor :objects
120
+ attr_accessor :total_count
121
+
122
+ def total_count=(val)
123
+ @total_count = val.to_i
124
+ end
125
+ end
126
+
127
+ class KalturaMetadataProfile < KalturaObjectBase
128
+ attr_accessor :id
129
+ attr_accessor :partner_id
130
+ attr_accessor :metadata_object_type
131
+ attr_accessor :version
132
+ attr_accessor :name
133
+ attr_accessor :system_name
134
+ attr_accessor :description
135
+ attr_accessor :created_at
136
+ attr_accessor :updated_at
137
+ attr_accessor :status
138
+ attr_accessor :xsd
139
+ attr_accessor :views
140
+ attr_accessor :xslt
141
+ attr_accessor :create_mode
142
+
143
+ def id=(val)
144
+ @id = val.to_i
145
+ end
146
+ def partner_id=(val)
147
+ @partner_id = val.to_i
148
+ end
149
+ def version=(val)
150
+ @version = val.to_i
151
+ end
152
+ def created_at=(val)
153
+ @created_at = val.to_i
154
+ end
155
+ def updated_at=(val)
156
+ @updated_at = val.to_i
157
+ end
158
+ def status=(val)
159
+ @status = val.to_i
160
+ end
161
+ def create_mode=(val)
162
+ @create_mode = val.to_i
163
+ end
164
+ end
165
+
166
+ class KalturaMetadataProfileField < KalturaObjectBase
167
+ attr_accessor :id
168
+ attr_accessor :x_path
169
+ attr_accessor :key
170
+ attr_accessor :label
171
+
172
+ def id=(val)
173
+ @id = val.to_i
174
+ end
175
+ end
176
+
177
+ class KalturaMetadataProfileFieldListResponse < KalturaObjectBase
178
+ attr_accessor :objects
179
+ attr_accessor :total_count
180
+
181
+ def total_count=(val)
182
+ @total_count = val.to_i
183
+ end
184
+ end
185
+
186
+ class KalturaMetadataProfileListResponse < KalturaObjectBase
187
+ attr_accessor :objects
188
+ attr_accessor :total_count
189
+
190
+ def total_count=(val)
191
+ @total_count = val.to_i
192
+ end
193
+ end
194
+
195
+ class KalturaImportMetadataJobData < KalturaJobData
196
+ attr_accessor :src_file_url
197
+ attr_accessor :dest_file_local_path
198
+ attr_accessor :metadata_id
199
+
200
+ def metadata_id=(val)
201
+ @metadata_id = val.to_i
202
+ end
203
+ end
204
+
205
+ class KalturaMetadataBaseFilter < KalturaFilter
206
+ attr_accessor :partner_id_equal
207
+ attr_accessor :metadata_profile_id_equal
208
+ attr_accessor :metadata_profile_version_equal
209
+ attr_accessor :metadata_profile_version_greater_than_or_equal
210
+ attr_accessor :metadata_profile_version_less_than_or_equal
211
+ attr_accessor :metadata_object_type_equal
212
+ attr_accessor :object_id_equal
213
+ attr_accessor :object_id_in
214
+ attr_accessor :version_equal
215
+ attr_accessor :version_greater_than_or_equal
216
+ attr_accessor :version_less_than_or_equal
217
+ attr_accessor :created_at_greater_than_or_equal
218
+ attr_accessor :created_at_less_than_or_equal
219
+ attr_accessor :updated_at_greater_than_or_equal
220
+ attr_accessor :updated_at_less_than_or_equal
221
+ attr_accessor :status_equal
222
+ attr_accessor :status_in
223
+
224
+ def partner_id_equal=(val)
225
+ @partner_id_equal = val.to_i
226
+ end
227
+ def metadata_profile_id_equal=(val)
228
+ @metadata_profile_id_equal = val.to_i
229
+ end
230
+ def metadata_profile_version_equal=(val)
231
+ @metadata_profile_version_equal = val.to_i
232
+ end
233
+ def metadata_profile_version_greater_than_or_equal=(val)
234
+ @metadata_profile_version_greater_than_or_equal = val.to_i
235
+ end
236
+ def metadata_profile_version_less_than_or_equal=(val)
237
+ @metadata_profile_version_less_than_or_equal = val.to_i
238
+ end
239
+ def version_equal=(val)
240
+ @version_equal = val.to_i
241
+ end
242
+ def version_greater_than_or_equal=(val)
243
+ @version_greater_than_or_equal = val.to_i
244
+ end
245
+ def version_less_than_or_equal=(val)
246
+ @version_less_than_or_equal = val.to_i
247
+ end
248
+ def created_at_greater_than_or_equal=(val)
249
+ @created_at_greater_than_or_equal = val.to_i
250
+ end
251
+ def created_at_less_than_or_equal=(val)
252
+ @created_at_less_than_or_equal = val.to_i
253
+ end
254
+ def updated_at_greater_than_or_equal=(val)
255
+ @updated_at_greater_than_or_equal = val.to_i
256
+ end
257
+ def updated_at_less_than_or_equal=(val)
258
+ @updated_at_less_than_or_equal = val.to_i
259
+ end
260
+ def status_equal=(val)
261
+ @status_equal = val.to_i
262
+ end
263
+ end
264
+
265
+ class KalturaMetadataProfileBaseFilter < KalturaFilter
266
+ attr_accessor :id_equal
267
+ attr_accessor :partner_id_equal
268
+ attr_accessor :metadata_object_type_equal
269
+ attr_accessor :metadata_object_type_in
270
+ attr_accessor :version_equal
271
+ attr_accessor :name_equal
272
+ attr_accessor :system_name_equal
273
+ attr_accessor :system_name_in
274
+ attr_accessor :created_at_greater_than_or_equal
275
+ attr_accessor :created_at_less_than_or_equal
276
+ attr_accessor :updated_at_greater_than_or_equal
277
+ attr_accessor :updated_at_less_than_or_equal
278
+ attr_accessor :status_equal
279
+ attr_accessor :status_in
280
+ attr_accessor :create_mode_equal
281
+ attr_accessor :create_mode_not_equal
282
+ attr_accessor :create_mode_in
283
+ attr_accessor :create_mode_not_in
284
+
285
+ def id_equal=(val)
286
+ @id_equal = val.to_i
287
+ end
288
+ def partner_id_equal=(val)
289
+ @partner_id_equal = val.to_i
290
+ end
291
+ def version_equal=(val)
292
+ @version_equal = val.to_i
293
+ end
294
+ def created_at_greater_than_or_equal=(val)
295
+ @created_at_greater_than_or_equal = val.to_i
296
+ end
297
+ def created_at_less_than_or_equal=(val)
298
+ @created_at_less_than_or_equal = val.to_i
299
+ end
300
+ def updated_at_greater_than_or_equal=(val)
301
+ @updated_at_greater_than_or_equal = val.to_i
302
+ end
303
+ def updated_at_less_than_or_equal=(val)
304
+ @updated_at_less_than_or_equal = val.to_i
305
+ end
306
+ def status_equal=(val)
307
+ @status_equal = val.to_i
308
+ end
309
+ def create_mode_equal=(val)
310
+ @create_mode_equal = val.to_i
311
+ end
312
+ def create_mode_not_equal=(val)
313
+ @create_mode_not_equal = val.to_i
314
+ end
315
+ end
316
+
317
+ class KalturaTransformMetadataJobData < KalturaJobData
318
+ attr_accessor :src_xsl_path
319
+ attr_accessor :src_version
320
+ attr_accessor :dest_version
321
+ attr_accessor :dest_xsd_path
322
+ attr_accessor :metadata_profile_id
323
+
324
+ def src_version=(val)
325
+ @src_version = val.to_i
326
+ end
327
+ def dest_version=(val)
328
+ @dest_version = val.to_i
329
+ end
330
+ def metadata_profile_id=(val)
331
+ @metadata_profile_id = val.to_i
332
+ end
333
+ end
334
+
335
+ class KalturaCompareMetadataCondition < KalturaCompareCondition
336
+ # May contain the full xpath to the field in three formats
337
+ # 1. Slashed xPath, e.g. /metadata/myElementName
338
+ # 2. Using local-name function, e.g. /[local-name()='metadata']/[local-name()='myElementName']
339
+ # 3. Using only the field name, e.g. myElementName, it will be searched as //myElementName
340
+ #
341
+ attr_accessor :x_path
342
+ # Metadata profile id
343
+ #
344
+ attr_accessor :profile_id
345
+ # Metadata profile system name
346
+ #
347
+ attr_accessor :profile_system_name
348
+
349
+ def profile_id=(val)
350
+ @profile_id = val.to_i
351
+ end
352
+ end
353
+
354
+ class KalturaMatchMetadataCondition < KalturaMatchCondition
355
+ # May contain the full xpath to the field in three formats
356
+ # 1. Slashed xPath, e.g. /metadata/myElementName
357
+ # 2. Using local-name function, e.g. /[local-name()='metadata']/[local-name()='myElementName']
358
+ # 3. Using only the field name, e.g. myElementName, it will be searched as //myElementName
359
+ #
360
+ attr_accessor :x_path
361
+ # Metadata profile id
362
+ #
363
+ attr_accessor :profile_id
364
+ # Metadata profile system name
365
+ #
366
+ attr_accessor :profile_system_name
367
+
368
+ def profile_id=(val)
369
+ @profile_id = val.to_i
370
+ end
371
+ end
372
+
373
+ class KalturaMetadataFieldChangedCondition < KalturaMatchCondition
374
+ # May contain the full xpath to the field in three formats
375
+ # 1. Slashed xPath, e.g. /metadata/myElementName
376
+ # 2. Using local-name function, e.g. /[local-name()='metadata']/[local-name()='myElementName']
377
+ # 3. Using only the field name, e.g. myElementName, it will be searched as //myElementName
378
+ #
379
+ attr_accessor :x_path
380
+ # Metadata profile id
381
+ #
382
+ attr_accessor :profile_id
383
+ # Metadata profile system name
384
+ #
385
+ attr_accessor :profile_system_name
386
+ attr_accessor :version_a
387
+ attr_accessor :version_b
388
+
389
+ def profile_id=(val)
390
+ @profile_id = val.to_i
391
+ end
392
+ end
393
+
394
+ class KalturaMetadataFilter < KalturaMetadataBaseFilter
395
+
396
+ end
397
+
398
+ class KalturaMetadataProfileFilter < KalturaMetadataProfileBaseFilter
399
+
400
+ end
401
+
402
+ class KalturaMetadataSearchItem < KalturaSearchOperator
403
+ attr_accessor :metadata_profile_id
404
+ attr_accessor :order_by
405
+
406
+ def metadata_profile_id=(val)
407
+ @metadata_profile_id = val.to_i
408
+ end
409
+ end
410
+
411
+
412
+ # Metadata service
413
+ #
414
+ class KalturaMetadataService < KalturaServiceBase
415
+ def initialize(client)
416
+ super(client)
417
+ end
418
+
419
+ # Allows you to add a metadata object and metadata content associated with Kaltura object
420
+ #
421
+ def add(metadata_profile_id, object_type, object_id, xml_data)
422
+ kparams = {}
423
+ client.add_param(kparams, 'metadataProfileId', metadata_profile_id);
424
+ client.add_param(kparams, 'objectType', object_type);
425
+ client.add_param(kparams, 'objectId', object_id);
426
+ # XML metadata
427
+ client.add_param(kparams, 'xmlData', xml_data);
428
+ client.queue_service_action_call('metadata_metadata', 'add', kparams);
429
+ if (client.is_multirequest)
430
+ return nil;
431
+ end
432
+ return client.do_queue();
433
+ end
434
+
435
+ # Allows you to add a metadata object and metadata file associated with Kaltura object
436
+ #
437
+ def add_from_file(metadata_profile_id, object_type, object_id, xml_file)
438
+ kparams = {}
439
+ client.add_param(kparams, 'metadataProfileId', metadata_profile_id);
440
+ client.add_param(kparams, 'objectType', object_type);
441
+ client.add_param(kparams, 'objectId', object_id);
442
+ # XML metadata
443
+ client.add_param(kparams, 'xmlFile', xml_file);
444
+ client.queue_service_action_call('metadata_metadata', 'addFromFile', kparams);
445
+ if (client.is_multirequest)
446
+ return nil;
447
+ end
448
+ return client.do_queue();
449
+ end
450
+
451
+ # Allows you to add a metadata xml data from remote URL
452
+ #
453
+ def add_from_url(metadata_profile_id, object_type, object_id, url)
454
+ kparams = {}
455
+ client.add_param(kparams, 'metadataProfileId', metadata_profile_id);
456
+ client.add_param(kparams, 'objectType', object_type);
457
+ client.add_param(kparams, 'objectId', object_id);
458
+ # XML metadata remote url
459
+ client.add_param(kparams, 'url', url);
460
+ client.queue_service_action_call('metadata_metadata', 'addFromUrl', kparams);
461
+ if (client.is_multirequest)
462
+ return nil;
463
+ end
464
+ return client.do_queue();
465
+ end
466
+
467
+ # Allows you to add a metadata xml data from remote URL.
468
+ # Enables different permissions than addFromUrl action.
469
+ #
470
+ def add_from_bulk(metadata_profile_id, object_type, object_id, url)
471
+ kparams = {}
472
+ client.add_param(kparams, 'metadataProfileId', metadata_profile_id);
473
+ client.add_param(kparams, 'objectType', object_type);
474
+ client.add_param(kparams, 'objectId', object_id);
475
+ # XML metadata remote url
476
+ client.add_param(kparams, 'url', url);
477
+ client.queue_service_action_call('metadata_metadata', 'addFromBulk', kparams);
478
+ if (client.is_multirequest)
479
+ return nil;
480
+ end
481
+ return client.do_queue();
482
+ end
483
+
484
+ # Retrieve a metadata object by id
485
+ #
486
+ def get(id)
487
+ kparams = {}
488
+ client.add_param(kparams, 'id', id);
489
+ client.queue_service_action_call('metadata_metadata', 'get', kparams);
490
+ if (client.is_multirequest)
491
+ return nil;
492
+ end
493
+ return client.do_queue();
494
+ end
495
+
496
+ # Update an existing metadata object with new XML content
497
+ #
498
+ def update(id, xml_data=KalturaNotImplemented, version=KalturaNotImplemented)
499
+ kparams = {}
500
+ client.add_param(kparams, 'id', id);
501
+ # XML metadata
502
+ client.add_param(kparams, 'xmlData', xml_data);
503
+ # Enable update only if the metadata object version did not change by other process
504
+ client.add_param(kparams, 'version', version);
505
+ client.queue_service_action_call('metadata_metadata', 'update', kparams);
506
+ if (client.is_multirequest)
507
+ return nil;
508
+ end
509
+ return client.do_queue();
510
+ end
511
+
512
+ # Update an existing metadata object with new XML file
513
+ #
514
+ def update_from_file(id, xml_file=KalturaNotImplemented)
515
+ kparams = {}
516
+ client.add_param(kparams, 'id', id);
517
+ # XML metadata
518
+ client.add_param(kparams, 'xmlFile', xml_file);
519
+ client.queue_service_action_call('metadata_metadata', 'updateFromFile', kparams);
520
+ if (client.is_multirequest)
521
+ return nil;
522
+ end
523
+ return client.do_queue();
524
+ end
525
+
526
+ # List metadata objects by filter and pager
527
+ #
528
+ def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
529
+ kparams = {}
530
+ client.add_param(kparams, 'filter', filter);
531
+ client.add_param(kparams, 'pager', pager);
532
+ client.queue_service_action_call('metadata_metadata', 'list', kparams);
533
+ if (client.is_multirequest)
534
+ return nil;
535
+ end
536
+ return client.do_queue();
537
+ end
538
+
539
+ # Delete an existing metadata
540
+ #
541
+ def delete(id)
542
+ kparams = {}
543
+ client.add_param(kparams, 'id', id);
544
+ client.queue_service_action_call('metadata_metadata', 'delete', kparams);
545
+ if (client.is_multirequest)
546
+ return nil;
547
+ end
548
+ return client.do_queue();
549
+ end
550
+
551
+ # Mark existing metadata as invalid
552
+ # Used by batch metadata transform
553
+ #
554
+ def invalidate(id, version=KalturaNotImplemented)
555
+ kparams = {}
556
+ client.add_param(kparams, 'id', id);
557
+ # Enable update only if the metadata object version did not change by other process
558
+ client.add_param(kparams, 'version', version);
559
+ client.queue_service_action_call('metadata_metadata', 'invalidate', kparams);
560
+ if (client.is_multirequest)
561
+ return nil;
562
+ end
563
+ return client.do_queue();
564
+ end
565
+
566
+ # Serves metadata XML file
567
+ #
568
+ def serve(id)
569
+ kparams = {}
570
+ client.add_param(kparams, 'id', id);
571
+ client.queue_service_action_call('metadata_metadata', 'serve', kparams);
572
+ return client.get_serve_url();
573
+ end
574
+
575
+ # Action transforms current metadata object XML using a provided XSL.
576
+ #
577
+ def update_from_xsl(id, xsl_file)
578
+ kparams = {}
579
+ client.add_param(kparams, 'id', id);
580
+ client.add_param(kparams, 'xslFile', xsl_file);
581
+ client.queue_service_action_call('metadata_metadata', 'updateFromXSL', kparams);
582
+ if (client.is_multirequest)
583
+ return nil;
584
+ end
585
+ return client.do_queue();
586
+ end
587
+ end
588
+
589
+ # Metadata Profile service
590
+ #
591
+ class KalturaMetadataProfileService < KalturaServiceBase
592
+ def initialize(client)
593
+ super(client)
594
+ end
595
+
596
+ # Allows you to add a metadata profile object and metadata profile content associated with Kaltura object type
597
+ #
598
+ def add(metadata_profile, xsd_data, views_data=KalturaNotImplemented)
599
+ kparams = {}
600
+ client.add_param(kparams, 'metadataProfile', metadata_profile);
601
+ # XSD metadata definition
602
+ client.add_param(kparams, 'xsdData', xsd_data);
603
+ # UI views definition
604
+ client.add_param(kparams, 'viewsData', views_data);
605
+ client.queue_service_action_call('metadata_metadataprofile', 'add', kparams);
606
+ if (client.is_multirequest)
607
+ return nil;
608
+ end
609
+ return client.do_queue();
610
+ end
611
+
612
+ # Allows you to add a metadata profile object and metadata profile file associated with Kaltura object type
613
+ #
614
+ def add_from_file(metadata_profile, xsd_file, views_file=KalturaNotImplemented)
615
+ kparams = {}
616
+ client.add_param(kparams, 'metadataProfile', metadata_profile);
617
+ # XSD metadata definition
618
+ client.add_param(kparams, 'xsdFile', xsd_file);
619
+ # UI views definition
620
+ client.add_param(kparams, 'viewsFile', views_file);
621
+ client.queue_service_action_call('metadata_metadataprofile', 'addFromFile', kparams);
622
+ if (client.is_multirequest)
623
+ return nil;
624
+ end
625
+ return client.do_queue();
626
+ end
627
+
628
+ # Retrieve a metadata profile object by id
629
+ #
630
+ def get(id)
631
+ kparams = {}
632
+ client.add_param(kparams, 'id', id);
633
+ client.queue_service_action_call('metadata_metadataprofile', 'get', kparams);
634
+ if (client.is_multirequest)
635
+ return nil;
636
+ end
637
+ return client.do_queue();
638
+ end
639
+
640
+ # Update an existing metadata object
641
+ #
642
+ def update(id, metadata_profile, xsd_data=KalturaNotImplemented, views_data=KalturaNotImplemented)
643
+ kparams = {}
644
+ client.add_param(kparams, 'id', id);
645
+ client.add_param(kparams, 'metadataProfile', metadata_profile);
646
+ # XSD metadata definition
647
+ client.add_param(kparams, 'xsdData', xsd_data);
648
+ # UI views definition
649
+ client.add_param(kparams, 'viewsData', views_data);
650
+ client.queue_service_action_call('metadata_metadataprofile', 'update', kparams);
651
+ if (client.is_multirequest)
652
+ return nil;
653
+ end
654
+ return client.do_queue();
655
+ end
656
+
657
+ # List metadata profile objects by filter and pager
658
+ #
659
+ def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
660
+ kparams = {}
661
+ client.add_param(kparams, 'filter', filter);
662
+ client.add_param(kparams, 'pager', pager);
663
+ client.queue_service_action_call('metadata_metadataprofile', 'list', kparams);
664
+ if (client.is_multirequest)
665
+ return nil;
666
+ end
667
+ return client.do_queue();
668
+ end
669
+
670
+ # List metadata profile fields by metadata profile id
671
+ #
672
+ def list_fields(metadata_profile_id)
673
+ kparams = {}
674
+ client.add_param(kparams, 'metadataProfileId', metadata_profile_id);
675
+ client.queue_service_action_call('metadata_metadataprofile', 'listFields', kparams);
676
+ if (client.is_multirequest)
677
+ return nil;
678
+ end
679
+ return client.do_queue();
680
+ end
681
+
682
+ # Delete an existing metadata profile
683
+ #
684
+ def delete(id)
685
+ kparams = {}
686
+ client.add_param(kparams, 'id', id);
687
+ client.queue_service_action_call('metadata_metadataprofile', 'delete', kparams);
688
+ if (client.is_multirequest)
689
+ return nil;
690
+ end
691
+ return client.do_queue();
692
+ end
693
+
694
+ # Update an existing metadata object definition file
695
+ #
696
+ def revert(id, to_version)
697
+ kparams = {}
698
+ client.add_param(kparams, 'id', id);
699
+ client.add_param(kparams, 'toVersion', to_version);
700
+ client.queue_service_action_call('metadata_metadataprofile', 'revert', kparams);
701
+ if (client.is_multirequest)
702
+ return nil;
703
+ end
704
+ return client.do_queue();
705
+ end
706
+
707
+ # Update an existing metadata object definition file
708
+ #
709
+ def update_definition_from_file(id, xsd_file)
710
+ kparams = {}
711
+ client.add_param(kparams, 'id', id);
712
+ # XSD metadata definition
713
+ client.add_param(kparams, 'xsdFile', xsd_file);
714
+ client.queue_service_action_call('metadata_metadataprofile', 'updateDefinitionFromFile', kparams);
715
+ if (client.is_multirequest)
716
+ return nil;
717
+ end
718
+ return client.do_queue();
719
+ end
720
+
721
+ # Update an existing metadata object views file
722
+ #
723
+ def update_views_from_file(id, views_file)
724
+ kparams = {}
725
+ client.add_param(kparams, 'id', id);
726
+ # UI views file
727
+ client.add_param(kparams, 'viewsFile', views_file);
728
+ client.queue_service_action_call('metadata_metadataprofile', 'updateViewsFromFile', kparams);
729
+ if (client.is_multirequest)
730
+ return nil;
731
+ end
732
+ return client.do_queue();
733
+ end
734
+
735
+ # Update an existing metadata object xslt file
736
+ #
737
+ def update_transformation_from_file(id, xslt_file)
738
+ kparams = {}
739
+ client.add_param(kparams, 'id', id);
740
+ # XSLT file, will be executed on every metadata add/update
741
+ client.add_param(kparams, 'xsltFile', xslt_file);
742
+ client.queue_service_action_call('metadata_metadataprofile', 'updateTransformationFromFile', kparams);
743
+ if (client.is_multirequest)
744
+ return nil;
745
+ end
746
+ return client.do_queue();
747
+ end
748
+
749
+ # Serves metadata profile XSD file
750
+ #
751
+ def serve(id)
752
+ kparams = {}
753
+ client.add_param(kparams, 'id', id);
754
+ client.queue_service_action_call('metadata_metadataprofile', 'serve', kparams);
755
+ return client.get_serve_url();
756
+ end
757
+
758
+ # Serves metadata profile view file
759
+ #
760
+ def serve_view(id)
761
+ kparams = {}
762
+ client.add_param(kparams, 'id', id);
763
+ client.queue_service_action_call('metadata_metadataprofile', 'serveView', kparams);
764
+ return client.get_serve_url();
765
+ end
766
+ end
767
+
768
+ class KalturaClient < KalturaClientBase
769
+ attr_reader :metadata_service
770
+ def metadata_service
771
+ if (@metadata_service == nil)
772
+ @metadata_service = KalturaMetadataService.new(self)
773
+ end
774
+ return @metadata_service
775
+ end
776
+ attr_reader :metadata_profile_service
777
+ def metadata_profile_service
778
+ if (@metadata_profile_service == nil)
779
+ @metadata_profile_service = KalturaMetadataProfileService.new(self)
780
+ end
781
+ return @metadata_profile_service
782
+ end
783
+ end
784
+
785
+ end