-
Notifications
You must be signed in to change notification settings - Fork 0
/
KalturaCampaignService.js
64 lines (59 loc) · 1.76 KB
/
KalturaCampaignService.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
/**
*Class definition for the Kaltura service: campaign.
**/
var KalturaCampaignService = {
/**
* Add new Campaign.
* @param objectToAdd KalturaCampaign Campaign Object to add (optional)
**/
add: function(objectToAdd){
var kparams = new Object();
kparams.objectToAdd = objectToAdd;
return new KalturaRequestBuilder("campaign", "add", kparams);
},
/**
* Delete existing Campaign.
* @param id int Campaign identifier (optional)
**/
deleteAction: function(id){
var kparams = new Object();
kparams.id = id;
return new KalturaRequestBuilder("campaign", "delete", kparams);
},
/**
* Returns the list of available Campaigns.
* @param filter KalturaCampaignFilter 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("campaign", "list", kparams);
},
/**
* Set campaign's state.
* @param campaignId int campaign Id (optional)
* @param newState string new campaign state (optional, enum: KalturaObjectState)
**/
setState: function(campaignId, newState){
var kparams = new Object();
kparams.campaignId = campaignId;
kparams.newState = newState;
return new KalturaRequestBuilder("campaign", "setState", kparams);
},
/**
* Update existing Campaign.
* @param id int id of Campaign to update (optional)
* @param objectToUpdate KalturaCampaign Campaign Object to update (optional)
**/
update: function(id, objectToUpdate){
var kparams = new Object();
kparams.id = id;
kparams.objectToUpdate = objectToUpdate;
return new KalturaRequestBuilder("campaign", "update", kparams);
}
}