-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKalturaCategoryVersionService.js
80 lines (74 loc) · 2.39 KB
/
KalturaCategoryVersionService.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**
*Class definition for the Kaltura service: categoryVersion.
**/
var KalturaCategoryVersionService = {
/**
* categoryVersion add.
* @param objectToAdd KalturaCategoryVersion categoryVersion details (optional)
**/
add: function(objectToAdd){
var kparams = new Object();
kparams.objectToAdd = objectToAdd;
return new KalturaRequestBuilder("categoryversion", "add", kparams);
},
/**
* Acreate new tree for this categoryItem.
* @param categoryItemId int the categoryItemId to create the tree accordingly (optional)
* @param name string Name of version (optional)
* @param comment string Comment of version (optional)
**/
createTree: function(categoryItemId, name, comment){
var kparams = new Object();
kparams.categoryItemId = categoryItemId;
kparams.name = name;
kparams.comment = comment;
return new KalturaRequestBuilder("categoryversion", "createTree", kparams);
},
/**
* Remove category version.
* @param id int Category version identifier (optional)
**/
deleteAction: function(id){
var kparams = new Object();
kparams.id = id;
return new KalturaRequestBuilder("categoryversion", "delete", kparams);
},
/**
* Gets all category versions.
* @param filter KalturaCategoryVersionFilter Filter (optional)
* @param pager KalturaFilterPager Pager (optional, default: null)
**/
listAction: function(filter, pager){
if(!pager)
pager = null;
var kparams = new Object();
kparams.filter = filter;
if (pager != null)
kparams.pager = pager;
return new KalturaRequestBuilder("categoryversion", "list", kparams);
},
/**
* Set new default category version.
* @param id int category version id to set as default (optional)
* @param force bool force to set even if version is older then currenct version (optional, default: false)
**/
setDefault: function(id, force){
if(!force)
force = false;
var kparams = new Object();
kparams.id = id;
kparams.force = force;
return new KalturaRequestBuilder("categoryversion", "setDefault", kparams);
},
/**
* categoryVersion update.
* @param id int Category version identifier (optional)
* @param objectToUpdate KalturaCategoryVersion categoryVersion details (optional)
**/
update: function(id, objectToUpdate){
var kparams = new Object();
kparams.id = id;
kparams.objectToUpdate = objectToUpdate;
return new KalturaRequestBuilder("categoryversion", "update", kparams);
}
}