kaltura-client 15.17.0 → 16.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README +1 -1
- data/lib/kaltura_client.rb +52 -2
- data/lib/kaltura_enums.rb +19 -0
- data/lib/kaltura_plugins/kaltura_audit_client_plugin.rb +1 -0
- data/lib/kaltura_plugins/kaltura_caption_client_plugin.rb +13 -0
- data/lib/kaltura_plugins/kaltura_capture_space_client_plugin.rb +36 -0
- data/lib/kaltura_plugins/kaltura_conference_client_plugin.rb +152 -0
- data/lib/kaltura_plugins/kaltura_content_distribution_client_plugin.rb +1 -0
- data/lib/kaltura_plugins/kaltura_cross_kaltura_distribution_client_plugin.rb +5 -0
- data/lib/kaltura_plugins/kaltura_file_sync_client_plugin.rb +12 -0
- data/lib/kaltura_plugins/kaltura_interactivity_client_plugin.rb +217 -0
- data/lib/kaltura_plugins/kaltura_live_cluster_client_plugin.rb +60 -0
- data/lib/kaltura_plugins/kaltura_podcast_distribution_client_plugin.rb +140 -0
- data/lib/kaltura_plugins/kaltura_rating_client_plugin.rb +165 -0
- data/lib/kaltura_plugins/kaltura_reach_client_plugin.rb +90 -24
- data/lib/kaltura_plugins/kaltura_registration_client_plugin.rb +51 -0
- data/lib/kaltura_plugins/kaltura_scheduled_task_client_plugin.rb +8 -0
- data/lib/kaltura_plugins/kaltura_sip_client_plugin.rb +160 -0
- data/lib/kaltura_plugins/kaltura_sso_client_plugin.rb +282 -0
- data/lib/kaltura_plugins/kaltura_thumbnail_client_plugin.rb +63 -0
- data/lib/kaltura_plugins/kaltura_vendor_client_plugin.rb +180 -0
- data/lib/kaltura_plugins/kaltura_watch_later_client_plugin.rb +101 -0
- data/lib/kaltura_types.rb +247 -6
- metadata +14 -3
@@ -27,6 +27,7 @@
|
|
27
27
|
# ===================================================================================================
|
28
28
|
require 'kaltura_client.rb'
|
29
29
|
require File.dirname(__FILE__) + '/kaltura_event_notification_client_plugin.rb'
|
30
|
+
require File.dirname(__FILE__) + '/kaltura_bulk_upload_client_plugin.rb'
|
30
31
|
|
31
32
|
module Kaltura
|
32
33
|
|
@@ -87,6 +88,13 @@ module Kaltura
|
|
87
88
|
class KalturaVendorServiceTurnAroundTime
|
88
89
|
BEST_EFFORT = -1
|
89
90
|
IMMEDIATE = 0
|
91
|
+
ONE_BUSINESS_DAY = 1
|
92
|
+
TWO_BUSINESS_DAYS = 2
|
93
|
+
THREE_BUSINESS_DAYS = 3
|
94
|
+
FOUR_BUSINESS_DAYS = 4
|
95
|
+
FIVE_BUSINESS_DAYS = 5
|
96
|
+
SIX_BUSINESS_DAYS = 6
|
97
|
+
SEVEN_BUSINESS_DAYS = 7
|
90
98
|
THIRTY_MINUTES = 1800
|
91
99
|
TWO_HOURS = 7200
|
92
100
|
THREE_HOURS = 10800
|
@@ -286,6 +294,7 @@ module Kaltura
|
|
286
294
|
attr_accessor :expected_finish_time
|
287
295
|
attr_accessor :service_type
|
288
296
|
attr_accessor :service_feature
|
297
|
+
attr_accessor :turn_around_time
|
289
298
|
|
290
299
|
def id=(val)
|
291
300
|
@id = val.to_i
|
@@ -335,6 +344,9 @@ module Kaltura
|
|
335
344
|
def service_feature=(val)
|
336
345
|
@service_feature = val.to_i
|
337
346
|
end
|
347
|
+
def turn_around_time=(val)
|
348
|
+
@turn_around_time = val.to_i
|
349
|
+
end
|
338
350
|
|
339
351
|
def from_xml(xml_element)
|
340
352
|
super
|
@@ -422,6 +434,9 @@ module Kaltura
|
|
422
434
|
if xml_element.elements['serviceFeature'] != nil
|
423
435
|
self.service_feature = xml_element.elements['serviceFeature'].text
|
424
436
|
end
|
437
|
+
if xml_element.elements['turnAroundTime'] != nil
|
438
|
+
self.turn_around_time = xml_element.elements['turnAroundTime'].text
|
439
|
+
end
|
425
440
|
end
|
426
441
|
|
427
442
|
end
|
@@ -702,30 +717,6 @@ module Kaltura
|
|
702
717
|
|
703
718
|
end
|
704
719
|
|
705
|
-
class KalturaAlignmentVendorTaskData < KalturaVendorTaskData
|
706
|
-
# The id of the text transcript object the vendor should use while runing the alignment task
|
707
|
-
attr_accessor :text_transcript_asset_id
|
708
|
-
# Optional - The id of the json transcript object the vendor should update once alignment task processing is done
|
709
|
-
attr_accessor :json_transcript_asset_id
|
710
|
-
# Optional - The id of the caption asset object the vendor should update once alignment task processing is done
|
711
|
-
attr_accessor :caption_asset_id
|
712
|
-
|
713
|
-
|
714
|
-
def from_xml(xml_element)
|
715
|
-
super
|
716
|
-
if xml_element.elements['textTranscriptAssetId'] != nil
|
717
|
-
self.text_transcript_asset_id = xml_element.elements['textTranscriptAssetId'].text
|
718
|
-
end
|
719
|
-
if xml_element.elements['jsonTranscriptAssetId'] != nil
|
720
|
-
self.json_transcript_asset_id = xml_element.elements['jsonTranscriptAssetId'].text
|
721
|
-
end
|
722
|
-
if xml_element.elements['captionAssetId'] != nil
|
723
|
-
self.caption_asset_id = xml_element.elements['captionAssetId'].text
|
724
|
-
end
|
725
|
-
end
|
726
|
-
|
727
|
-
end
|
728
|
-
|
729
720
|
class KalturaCatalogItemAdvancedFilter < KalturaSearchItem
|
730
721
|
attr_accessor :service_type_equal
|
731
722
|
attr_accessor :service_type_in
|
@@ -1004,6 +995,39 @@ module Kaltura
|
|
1004
995
|
|
1005
996
|
end
|
1006
997
|
|
998
|
+
class KalturaVendorTaskDataCaptionAsset < KalturaVendorTaskData
|
999
|
+
# Optional - The id of the caption asset object
|
1000
|
+
attr_accessor :caption_asset_id
|
1001
|
+
|
1002
|
+
|
1003
|
+
def from_xml(xml_element)
|
1004
|
+
super
|
1005
|
+
if xml_element.elements['captionAssetId'] != nil
|
1006
|
+
self.caption_asset_id = xml_element.elements['captionAssetId'].text
|
1007
|
+
end
|
1008
|
+
end
|
1009
|
+
|
1010
|
+
end
|
1011
|
+
|
1012
|
+
class KalturaAlignmentVendorTaskData < KalturaVendorTaskDataCaptionAsset
|
1013
|
+
# The id of the text transcript object the vendor should use while runing the alignment task
|
1014
|
+
attr_accessor :text_transcript_asset_id
|
1015
|
+
# Optional - The id of the json transcript object the vendor should update once alignment task processing is done
|
1016
|
+
attr_accessor :json_transcript_asset_id
|
1017
|
+
|
1018
|
+
|
1019
|
+
def from_xml(xml_element)
|
1020
|
+
super
|
1021
|
+
if xml_element.elements['textTranscriptAssetId'] != nil
|
1022
|
+
self.text_transcript_asset_id = xml_element.elements['textTranscriptAssetId'].text
|
1023
|
+
end
|
1024
|
+
if xml_element.elements['jsonTranscriptAssetId'] != nil
|
1025
|
+
self.json_transcript_asset_id = xml_element.elements['jsonTranscriptAssetId'].text
|
1026
|
+
end
|
1027
|
+
end
|
1028
|
+
|
1029
|
+
end
|
1030
|
+
|
1007
1031
|
class KalturaEntryVendorTaskBaseFilter < KalturaRelatedFilter
|
1008
1032
|
attr_accessor :id_equal
|
1009
1033
|
attr_accessor :id_in
|
@@ -1293,6 +1317,15 @@ module Kaltura
|
|
1293
1317
|
|
1294
1318
|
end
|
1295
1319
|
|
1320
|
+
class KalturaTranslationVendorTaskData < KalturaVendorTaskDataCaptionAsset
|
1321
|
+
|
1322
|
+
|
1323
|
+
def from_xml(xml_element)
|
1324
|
+
super
|
1325
|
+
end
|
1326
|
+
|
1327
|
+
end
|
1328
|
+
|
1296
1329
|
class KalturaVendorCatalogItemBaseFilter < KalturaRelatedFilter
|
1297
1330
|
attr_accessor :id_equal
|
1298
1331
|
attr_accessor :id_in
|
@@ -1560,6 +1593,20 @@ module Kaltura
|
|
1560
1593
|
return client.do_queue()
|
1561
1594
|
end
|
1562
1595
|
|
1596
|
+
# @return [KalturaBulkUpload]
|
1597
|
+
def add_from_bulk_upload(file_data, bulk_upload_data=KalturaNotImplemented, bulk_upload_vendor_catalog_item_data=KalturaNotImplemented)
|
1598
|
+
kparams = {}
|
1599
|
+
kfiles = {}
|
1600
|
+
client.add_param(kfiles, 'fileData', file_data)
|
1601
|
+
client.add_param(kparams, 'bulkUploadData', bulk_upload_data)
|
1602
|
+
client.add_param(kparams, 'bulkUploadVendorCatalogItemData', bulk_upload_vendor_catalog_item_data)
|
1603
|
+
client.queue_service_action_call('reach_vendorcatalogitem', 'addFromBulkUpload', 'KalturaBulkUpload', kparams, kfiles)
|
1604
|
+
if (client.is_multirequest)
|
1605
|
+
return nil
|
1606
|
+
end
|
1607
|
+
return client.do_queue()
|
1608
|
+
end
|
1609
|
+
|
1563
1610
|
# Delete vedor catalog item object
|
1564
1611
|
# @return []
|
1565
1612
|
def delete(id)
|
@@ -1584,6 +1631,17 @@ module Kaltura
|
|
1584
1631
|
return client.do_queue()
|
1585
1632
|
end
|
1586
1633
|
|
1634
|
+
# @return [string]
|
1635
|
+
def get_serve_url(vendor_partner_id=KalturaNotImplemented)
|
1636
|
+
kparams = {}
|
1637
|
+
client.add_param(kparams, 'vendorPartnerId', vendor_partner_id)
|
1638
|
+
client.queue_service_action_call('reach_vendorcatalogitem', 'getServeUrl', 'string', kparams)
|
1639
|
+
if (client.is_multirequest)
|
1640
|
+
return nil
|
1641
|
+
end
|
1642
|
+
return client.do_queue()
|
1643
|
+
end
|
1644
|
+
|
1587
1645
|
# List KalturaVendorCatalogItem objects
|
1588
1646
|
# @return [KalturaVendorCatalogItemListResponse]
|
1589
1647
|
def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
|
@@ -1597,6 +1655,14 @@ module Kaltura
|
|
1597
1655
|
return client.do_queue()
|
1598
1656
|
end
|
1599
1657
|
|
1658
|
+
# @return [file]
|
1659
|
+
def serve(vendor_partner_id=KalturaNotImplemented)
|
1660
|
+
kparams = {}
|
1661
|
+
client.add_param(kparams, 'vendorPartnerId', vendor_partner_id)
|
1662
|
+
client.queue_service_action_call('reach_vendorcatalogitem', 'serve', 'file', kparams)
|
1663
|
+
return client.get_serve_url()
|
1664
|
+
end
|
1665
|
+
|
1600
1666
|
# Update an existing vedor catalog item object
|
1601
1667
|
# @return [KalturaVendorCatalogItem]
|
1602
1668
|
def update(id, vendor_catalog_item)
|
@@ -0,0 +1,51 @@
|
|
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-2020 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 KalturaRegistrationUserEntry < KalturaUserEntry
|
33
|
+
|
34
|
+
|
35
|
+
def from_xml(xml_element)
|
36
|
+
super
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
class KalturaRegistrationUserEntryFilter < KalturaUserEntryFilter
|
42
|
+
|
43
|
+
|
44
|
+
def from_xml(xml_element)
|
45
|
+
super
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
end
|
@@ -336,6 +336,8 @@ module Kaltura
|
|
336
336
|
attr_accessor :input_entitled_users_edit
|
337
337
|
# The input entitled users publish to set on the entry
|
338
338
|
attr_accessor :input_entitled_users_publish
|
339
|
+
# Should clear the media repurposing data and therefore reset the process
|
340
|
+
attr_accessor :reset_media_repurposing_process
|
339
341
|
|
340
342
|
def input_metadata_profile_id=(val)
|
341
343
|
@input_metadata_profile_id = val.to_i
|
@@ -343,6 +345,9 @@ module Kaltura
|
|
343
345
|
def output_metadata_profile_id=(val)
|
344
346
|
@output_metadata_profile_id = val.to_i
|
345
347
|
end
|
348
|
+
def reset_media_repurposing_process=(val)
|
349
|
+
@reset_media_repurposing_process = to_b(val)
|
350
|
+
end
|
346
351
|
|
347
352
|
def from_xml(xml_element)
|
348
353
|
super
|
@@ -367,6 +372,9 @@ module Kaltura
|
|
367
372
|
if xml_element.elements['inputEntitledUsersPublish'] != nil
|
368
373
|
self.input_entitled_users_publish = xml_element.elements['inputEntitledUsersPublish'].text
|
369
374
|
end
|
375
|
+
if xml_element.elements['resetMediaRepurposingProcess'] != nil
|
376
|
+
self.reset_media_repurposing_process = xml_element.elements['resetMediaRepurposingProcess'].text
|
377
|
+
end
|
370
378
|
end
|
371
379
|
|
372
380
|
end
|
@@ -0,0 +1,160 @@
|
|
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-2020 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 KalturaSipServerNodeOrderBy
|
33
|
+
CREATED_AT_ASC = "+createdAt"
|
34
|
+
HEARTBEAT_TIME_ASC = "+heartbeatTime"
|
35
|
+
UPDATED_AT_ASC = "+updatedAt"
|
36
|
+
CREATED_AT_DESC = "-createdAt"
|
37
|
+
HEARTBEAT_TIME_DESC = "-heartbeatTime"
|
38
|
+
UPDATED_AT_DESC = "-updatedAt"
|
39
|
+
end
|
40
|
+
|
41
|
+
class KalturaSipEntryServerNode < KalturaEntryServerNode
|
42
|
+
attr_accessor :sip_room_id
|
43
|
+
attr_accessor :sip_primary_adp_id
|
44
|
+
attr_accessor :sip_secondary_adp_id
|
45
|
+
|
46
|
+
|
47
|
+
def from_xml(xml_element)
|
48
|
+
super
|
49
|
+
if xml_element.elements['sipRoomId'] != nil
|
50
|
+
self.sip_room_id = xml_element.elements['sipRoomId'].text
|
51
|
+
end
|
52
|
+
if xml_element.elements['sipPrimaryAdpId'] != nil
|
53
|
+
self.sip_primary_adp_id = xml_element.elements['sipPrimaryAdpId'].text
|
54
|
+
end
|
55
|
+
if xml_element.elements['sipSecondaryAdpId'] != nil
|
56
|
+
self.sip_secondary_adp_id = xml_element.elements['sipSecondaryAdpId'].text
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
class KalturaSipServerNode < KalturaServerNode
|
63
|
+
|
64
|
+
|
65
|
+
def from_xml(xml_element)
|
66
|
+
super
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
class KalturaSipEntryServerNodeBaseFilter < KalturaEntryServerNodeFilter
|
72
|
+
|
73
|
+
|
74
|
+
def from_xml(xml_element)
|
75
|
+
super
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
class KalturaSipServerNodeBaseFilter < KalturaServerNodeFilter
|
81
|
+
|
82
|
+
|
83
|
+
def from_xml(xml_element)
|
84
|
+
super
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
class KalturaSipEntryServerNodeFilter < KalturaSipEntryServerNodeBaseFilter
|
90
|
+
|
91
|
+
|
92
|
+
def from_xml(xml_element)
|
93
|
+
super
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
|
98
|
+
class KalturaSipServerNodeFilter < KalturaSipServerNodeBaseFilter
|
99
|
+
|
100
|
+
|
101
|
+
def from_xml(xml_element)
|
102
|
+
super
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
|
108
|
+
class KalturaPexipService < KalturaServiceBase
|
109
|
+
def initialize(client)
|
110
|
+
super(client)
|
111
|
+
end
|
112
|
+
|
113
|
+
# @return [string]
|
114
|
+
def generate_sip_url(entry_id, regenerate=false)
|
115
|
+
kparams = {}
|
116
|
+
client.add_param(kparams, 'entryId', entry_id)
|
117
|
+
client.add_param(kparams, 'regenerate', regenerate)
|
118
|
+
client.queue_service_action_call('sip_pexip', 'generateSipUrl', 'string', kparams)
|
119
|
+
if (client.is_multirequest)
|
120
|
+
return nil
|
121
|
+
end
|
122
|
+
return client.do_queue()
|
123
|
+
end
|
124
|
+
|
125
|
+
# @return [bool]
|
126
|
+
def handle_incoming_call()
|
127
|
+
kparams = {}
|
128
|
+
client.queue_service_action_call('sip_pexip', 'handleIncomingCall', 'bool', kparams)
|
129
|
+
if (client.is_multirequest)
|
130
|
+
return nil
|
131
|
+
end
|
132
|
+
return client.do_queue()
|
133
|
+
end
|
134
|
+
|
135
|
+
# @return [array]
|
136
|
+
def list_rooms(offset=0, page_size=500, active_only=false)
|
137
|
+
kparams = {}
|
138
|
+
client.add_param(kparams, 'offset', offset)
|
139
|
+
client.add_param(kparams, 'pageSize', page_size)
|
140
|
+
client.add_param(kparams, 'activeOnly', active_only)
|
141
|
+
client.queue_service_action_call('sip_pexip', 'listRooms', 'KalturaStringValue', kparams)
|
142
|
+
if (client.is_multirequest)
|
143
|
+
return nil
|
144
|
+
end
|
145
|
+
return client.do_queue()
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
class KalturaClient < KalturaClientBase
|
150
|
+
attr_reader :pexip_service
|
151
|
+
def pexip_service
|
152
|
+
if (@pexip_service == nil)
|
153
|
+
@pexip_service = KalturaPexipService.new(self)
|
154
|
+
end
|
155
|
+
return @pexip_service
|
156
|
+
end
|
157
|
+
|
158
|
+
end
|
159
|
+
|
160
|
+
end
|
@@ -0,0 +1,282 @@
|
|
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-2020 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 KalturaSsoStatus
|
33
|
+
DISABLED = 1
|
34
|
+
ACTIVE = 2
|
35
|
+
DELETED = 3
|
36
|
+
end
|
37
|
+
|
38
|
+
class KalturaSso < KalturaObjectBase
|
39
|
+
attr_accessor :id
|
40
|
+
attr_accessor :application_type
|
41
|
+
attr_accessor :partner_id
|
42
|
+
attr_accessor :domain
|
43
|
+
attr_accessor :status
|
44
|
+
# Creation date as Unix timestamp (In seconds)
|
45
|
+
attr_accessor :created_at
|
46
|
+
# Last update date as Unix timestamp (In seconds)
|
47
|
+
attr_accessor :updated_at
|
48
|
+
# Redirect URL for a specific application type and (partner id or domain)
|
49
|
+
attr_accessor :redirect_url
|
50
|
+
attr_accessor :data
|
51
|
+
|
52
|
+
def id=(val)
|
53
|
+
@id = val.to_i
|
54
|
+
end
|
55
|
+
def partner_id=(val)
|
56
|
+
@partner_id = val.to_i
|
57
|
+
end
|
58
|
+
def status=(val)
|
59
|
+
@status = val.to_i
|
60
|
+
end
|
61
|
+
def created_at=(val)
|
62
|
+
@created_at = val.to_i
|
63
|
+
end
|
64
|
+
def updated_at=(val)
|
65
|
+
@updated_at = val.to_i
|
66
|
+
end
|
67
|
+
|
68
|
+
def from_xml(xml_element)
|
69
|
+
super
|
70
|
+
if xml_element.elements['id'] != nil
|
71
|
+
self.id = xml_element.elements['id'].text
|
72
|
+
end
|
73
|
+
if xml_element.elements['applicationType'] != nil
|
74
|
+
self.application_type = xml_element.elements['applicationType'].text
|
75
|
+
end
|
76
|
+
if xml_element.elements['partnerId'] != nil
|
77
|
+
self.partner_id = xml_element.elements['partnerId'].text
|
78
|
+
end
|
79
|
+
if xml_element.elements['domain'] != nil
|
80
|
+
self.domain = xml_element.elements['domain'].text
|
81
|
+
end
|
82
|
+
if xml_element.elements['status'] != nil
|
83
|
+
self.status = xml_element.elements['status'].text
|
84
|
+
end
|
85
|
+
if xml_element.elements['createdAt'] != nil
|
86
|
+
self.created_at = xml_element.elements['createdAt'].text
|
87
|
+
end
|
88
|
+
if xml_element.elements['updatedAt'] != nil
|
89
|
+
self.updated_at = xml_element.elements['updatedAt'].text
|
90
|
+
end
|
91
|
+
if xml_element.elements['redirectUrl'] != nil
|
92
|
+
self.redirect_url = xml_element.elements['redirectUrl'].text
|
93
|
+
end
|
94
|
+
if xml_element.elements['data'] != nil
|
95
|
+
self.data = xml_element.elements['data'].text
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
class KalturaSsoListResponse < KalturaListResponse
|
102
|
+
attr_accessor :objects
|
103
|
+
|
104
|
+
|
105
|
+
def from_xml(xml_element)
|
106
|
+
super
|
107
|
+
if xml_element.elements['objects'] != nil
|
108
|
+
self.objects = KalturaClientBase.object_from_xml(xml_element.elements['objects'], 'KalturaSso')
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
end
|
113
|
+
|
114
|
+
class KalturaSsoBaseFilter < KalturaRelatedFilter
|
115
|
+
attr_accessor :id_equal
|
116
|
+
attr_accessor :id_in
|
117
|
+
attr_accessor :application_type_equal
|
118
|
+
attr_accessor :partner_id_equal
|
119
|
+
attr_accessor :domain_equal
|
120
|
+
attr_accessor :status_equal
|
121
|
+
attr_accessor :status_in
|
122
|
+
attr_accessor :created_at_greater_than_or_equal
|
123
|
+
attr_accessor :created_at_less_than_or_equal
|
124
|
+
attr_accessor :redirect_url_equal
|
125
|
+
|
126
|
+
def id_equal=(val)
|
127
|
+
@id_equal = val.to_i
|
128
|
+
end
|
129
|
+
def partner_id_equal=(val)
|
130
|
+
@partner_id_equal = val.to_i
|
131
|
+
end
|
132
|
+
def status_equal=(val)
|
133
|
+
@status_equal = val.to_i
|
134
|
+
end
|
135
|
+
def created_at_greater_than_or_equal=(val)
|
136
|
+
@created_at_greater_than_or_equal = val.to_i
|
137
|
+
end
|
138
|
+
def created_at_less_than_or_equal=(val)
|
139
|
+
@created_at_less_than_or_equal = val.to_i
|
140
|
+
end
|
141
|
+
|
142
|
+
def from_xml(xml_element)
|
143
|
+
super
|
144
|
+
if xml_element.elements['idEqual'] != nil
|
145
|
+
self.id_equal = xml_element.elements['idEqual'].text
|
146
|
+
end
|
147
|
+
if xml_element.elements['idIn'] != nil
|
148
|
+
self.id_in = xml_element.elements['idIn'].text
|
149
|
+
end
|
150
|
+
if xml_element.elements['applicationTypeEqual'] != nil
|
151
|
+
self.application_type_equal = xml_element.elements['applicationTypeEqual'].text
|
152
|
+
end
|
153
|
+
if xml_element.elements['partnerIdEqual'] != nil
|
154
|
+
self.partner_id_equal = xml_element.elements['partnerIdEqual'].text
|
155
|
+
end
|
156
|
+
if xml_element.elements['domainEqual'] != nil
|
157
|
+
self.domain_equal = xml_element.elements['domainEqual'].text
|
158
|
+
end
|
159
|
+
if xml_element.elements['statusEqual'] != nil
|
160
|
+
self.status_equal = xml_element.elements['statusEqual'].text
|
161
|
+
end
|
162
|
+
if xml_element.elements['statusIn'] != nil
|
163
|
+
self.status_in = xml_element.elements['statusIn'].text
|
164
|
+
end
|
165
|
+
if xml_element.elements['createdAtGreaterThanOrEqual'] != nil
|
166
|
+
self.created_at_greater_than_or_equal = xml_element.elements['createdAtGreaterThanOrEqual'].text
|
167
|
+
end
|
168
|
+
if xml_element.elements['createdAtLessThanOrEqual'] != nil
|
169
|
+
self.created_at_less_than_or_equal = xml_element.elements['createdAtLessThanOrEqual'].text
|
170
|
+
end
|
171
|
+
if xml_element.elements['redirectUrlEqual'] != nil
|
172
|
+
self.redirect_url_equal = xml_element.elements['redirectUrlEqual'].text
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
end
|
177
|
+
|
178
|
+
class KalturaSsoFilter < KalturaSsoBaseFilter
|
179
|
+
|
180
|
+
|
181
|
+
def from_xml(xml_element)
|
182
|
+
super
|
183
|
+
end
|
184
|
+
|
185
|
+
end
|
186
|
+
|
187
|
+
|
188
|
+
class KalturaSsoService < KalturaServiceBase
|
189
|
+
def initialize(client)
|
190
|
+
super(client)
|
191
|
+
end
|
192
|
+
|
193
|
+
# Adds a new sso configuration.
|
194
|
+
# @return [KalturaSso]
|
195
|
+
def add(sso)
|
196
|
+
kparams = {}
|
197
|
+
client.add_param(kparams, 'sso', sso)
|
198
|
+
client.queue_service_action_call('sso_sso', 'add', 'KalturaSso', kparams)
|
199
|
+
if (client.is_multirequest)
|
200
|
+
return nil
|
201
|
+
end
|
202
|
+
return client.do_queue()
|
203
|
+
end
|
204
|
+
|
205
|
+
# Delete sso by ID
|
206
|
+
# @return [KalturaSso]
|
207
|
+
def delete(sso_id)
|
208
|
+
kparams = {}
|
209
|
+
client.add_param(kparams, 'ssoId', sso_id)
|
210
|
+
client.queue_service_action_call('sso_sso', 'delete', 'KalturaSso', kparams)
|
211
|
+
if (client.is_multirequest)
|
212
|
+
return nil
|
213
|
+
end
|
214
|
+
return client.do_queue()
|
215
|
+
end
|
216
|
+
|
217
|
+
# Retrieves sso object
|
218
|
+
# @return [KalturaSso]
|
219
|
+
def get(sso_id)
|
220
|
+
kparams = {}
|
221
|
+
client.add_param(kparams, 'ssoId', sso_id)
|
222
|
+
client.queue_service_action_call('sso_sso', 'get', 'KalturaSso', kparams)
|
223
|
+
if (client.is_multirequest)
|
224
|
+
return nil
|
225
|
+
end
|
226
|
+
return client.do_queue()
|
227
|
+
end
|
228
|
+
|
229
|
+
# Lists sso objects that are associated with an account.
|
230
|
+
# @return [KalturaSsoListResponse]
|
231
|
+
def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
|
232
|
+
kparams = {}
|
233
|
+
client.add_param(kparams, 'filter', filter)
|
234
|
+
client.add_param(kparams, 'pager', pager)
|
235
|
+
client.queue_service_action_call('sso_sso', 'list', 'KalturaSsoListResponse', kparams)
|
236
|
+
if (client.is_multirequest)
|
237
|
+
return nil
|
238
|
+
end
|
239
|
+
return client.do_queue()
|
240
|
+
end
|
241
|
+
|
242
|
+
# Login with SSO, getting redirect url according to application type and partner Id
|
243
|
+
# or according to application type and domain
|
244
|
+
# @return [string]
|
245
|
+
def login(user_id, application_type, partner_id=KalturaNotImplemented)
|
246
|
+
kparams = {}
|
247
|
+
client.add_param(kparams, 'userId', user_id)
|
248
|
+
client.add_param(kparams, 'applicationType', application_type)
|
249
|
+
client.add_param(kparams, 'partnerId', partner_id)
|
250
|
+
client.queue_service_action_call('sso_sso', 'login', 'string', kparams)
|
251
|
+
if (client.is_multirequest)
|
252
|
+
return nil
|
253
|
+
end
|
254
|
+
return client.do_queue()
|
255
|
+
end
|
256
|
+
|
257
|
+
# Update sso by ID
|
258
|
+
# @return [KalturaSso]
|
259
|
+
def update(sso_id, sso)
|
260
|
+
kparams = {}
|
261
|
+
client.add_param(kparams, 'ssoId', sso_id)
|
262
|
+
client.add_param(kparams, 'sso', sso)
|
263
|
+
client.queue_service_action_call('sso_sso', 'update', 'KalturaSso', kparams)
|
264
|
+
if (client.is_multirequest)
|
265
|
+
return nil
|
266
|
+
end
|
267
|
+
return client.do_queue()
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
271
|
+
class KalturaClient < KalturaClientBase
|
272
|
+
attr_reader :sso_service
|
273
|
+
def sso_service
|
274
|
+
if (@sso_service == nil)
|
275
|
+
@sso_service = KalturaSsoService.new(self)
|
276
|
+
end
|
277
|
+
return @sso_service
|
278
|
+
end
|
279
|
+
|
280
|
+
end
|
281
|
+
|
282
|
+
end
|