kaltura-client
Version:
Kaltura NodeJS client library (new implementation)
1,555 lines (1,426 loc) • 376 kB
JavaScript
// ===================================================================================================
// _ __ _ _
// | |/ /__ _| | |_ _ _ _ _ __ _
// | ' </ _` | | _| || | '_/ _` |
// |_|\_\__,_|_|\__|\_,_|_| \__,_|
//
// This file is part of the Kaltura Collaborative Media Suite which allows users
// to do with audio, video, and animation what Wiki platforms allow them to do with
// text.
//
// Copyright (C) 2006-2023 Kaltura Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// @ignore
// ===================================================================================================
const kaltura = require('./KalturaClientBase');
/**
*Class definition for the Kaltura service: accessControlProfile.
* The available service actions:
* @action add Add new access control profile.
* @action delete Delete access control profile by id.
* @action get Get access control profile by id.
* @action list List access control profiles by filter and pager.
* @action update Update access control profile by id.
*/
class accessControlProfile{
/**
* Add new access control profile.
* @param accessControlProfile AccessControlProfile
* @return KalturaAccessControlProfile
*/
static add(accessControlProfile){
let kparams = {};
kparams.accessControlProfile = accessControlProfile;
return new kaltura.RequestBuilder('accesscontrolprofile', 'add', kparams);
};
/**
* Delete access control profile by id.
* @param id int
*/
static deleteAction(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('accesscontrolprofile', 'delete', kparams);
};
/**
* Get access control profile by id.
* @param id int
* @return KalturaAccessControlProfile
*/
static get(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('accesscontrolprofile', 'get', kparams);
};
/**
* List access control profiles by filter and pager.
* @param filter AccessControlProfileFilter (optional, default: null)
* @param pager FilterPager (optional, default: null)
* @return KalturaAccessControlProfileListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('accesscontrolprofile', 'list', kparams);
};
/**
* Update access control profile by id.
* @param id int
* @param accessControlProfile AccessControlProfile
* @return KalturaAccessControlProfile
*/
static update(id, accessControlProfile){
let kparams = {};
kparams.id = id;
kparams.accessControlProfile = accessControlProfile;
return new kaltura.RequestBuilder('accesscontrolprofile', 'update', kparams);
};
}
module.exports.accessControlProfile = accessControlProfile;
/**
*Class definition for the Kaltura service: accessControl.
* The available service actions:
* @action add Add new Access Control Profile.
* @action delete Delete Access Control Profile by id.
* @action get Get Access Control Profile by id.
* @action list List Access Control Profiles by filter and pager.
* @action update Update Access Control Profile by id.
*/
class accessControl{
/**
* Add new Access Control Profile.
* @param accessControl AccessControl
* @return KalturaAccessControl
*/
static add(accessControl){
let kparams = {};
kparams.accessControl = accessControl;
return new kaltura.RequestBuilder('accesscontrol', 'add', kparams);
};
/**
* Delete Access Control Profile by id.
* @param id int
*/
static deleteAction(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('accesscontrol', 'delete', kparams);
};
/**
* Get Access Control Profile by id.
* @param id int
* @return KalturaAccessControl
*/
static get(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('accesscontrol', 'get', kparams);
};
/**
* List Access Control Profiles by filter and pager.
* @param filter AccessControlFilter (optional, default: null)
* @param pager FilterPager (optional, default: null)
* @return KalturaAccessControlListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('accesscontrol', 'list', kparams);
};
/**
* Update Access Control Profile by id.
* @param id int
* @param accessControl AccessControl
* @return KalturaAccessControl
*/
static update(id, accessControl){
let kparams = {};
kparams.id = id;
kparams.accessControl = accessControl;
return new kaltura.RequestBuilder('accesscontrol', 'update', kparams);
};
}
module.exports.accessControl = accessControl;
/**
*Class definition for the Kaltura service: adminUser.
* The available service actions:
* @action login Get an admin session using admin email and password (Used for login to the KMC application).
* @action resetPassword Reset admin user password and send it to the users email address.
* @action setInitialPassword Set initial users password.
* @action updatePassword Update admin user password and email.
*/
class adminUser{
/**
* Get an admin session using admin email and password (Used for login to the KMC application).
* @param email string
* @param password string
* @param partnerId int (optional, default: null)
* @return string
*/
static login(email, password, partnerId = null){
let kparams = {};
kparams.email = email;
kparams.password = password;
kparams.partnerId = partnerId;
return new kaltura.RequestBuilder('adminuser', 'login', kparams);
};
/**
* Reset admin user password and send it to the users email address.
* @param email string
*/
static resetPassword(email){
let kparams = {};
kparams.email = email;
return new kaltura.RequestBuilder('adminuser', 'resetPassword', kparams);
};
/**
* Set initial users password.
* @param hashKey string
* @param newPassword string new password to set
* @return KalturaAuthentication
*/
static setInitialPassword(hashKey, newPassword){
let kparams = {};
kparams.hashKey = hashKey;
kparams.newPassword = newPassword;
return new kaltura.RequestBuilder('adminuser', 'setInitialPassword', kparams);
};
/**
* Update admin user password and email.
* @param email string
* @param password string
* @param newEmail string Optional, provide only when you want to update the email (optional)
* @param newPassword string (optional)
* @param otp string the user's one-time password (optional, default: null)
* @return KalturaAdminUser
*/
static updatePassword(email, password, newEmail = '', newPassword = '', otp = null){
let kparams = {};
kparams.email = email;
kparams.password = password;
kparams.newEmail = newEmail;
kparams.newPassword = newPassword;
kparams.otp = otp;
return new kaltura.RequestBuilder('adminuser', 'updatePassword', kparams);
};
}
module.exports.adminUser = adminUser;
/**
*Class definition for the Kaltura service: analytics.
* The available service actions:
* @action query report query action allows to get a analytics data for specific query dimensions, metrics and filters.
*/
class analytics{
/**
* report query action allows to get a analytics data for specific query dimensions, metrics and filters.
* @param filter AnalyticsFilter the analytics query filter
* @param pager FilterPager the analytics query result pager (optional, default: null)
* @return KalturaReportResponse
*/
static query(filter, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('analytics', 'query', kparams);
};
}
module.exports.analytics = analytics;
/**
*Class definition for the Kaltura service: appToken.
* The available service actions:
* @action add Add new application authentication token.
* @action delete Delete application authentication token by ID.
* @action get Get application authentication token by ID.
* @action list List application authentication tokens by filter and pager.
* @action startSession Starts a new KS (kaltura Session) based on an application authentication token ID.
* @action update Update application authentication token by ID.
*/
class appToken{
/**
* Add new application authentication token.
* @param appToken AppToken
* @return KalturaAppToken
*/
static add(appToken){
let kparams = {};
kparams.appToken = appToken;
return new kaltura.RequestBuilder('apptoken', 'add', kparams);
};
/**
* Delete application authentication token by ID.
* @param id string
*/
static deleteAction(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('apptoken', 'delete', kparams);
};
/**
* Get application authentication token by ID.
* @param id string
* @return KalturaAppToken
*/
static get(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('apptoken', 'get', kparams);
};
/**
* List application authentication tokens by filter and pager.
* @param filter AppTokenFilter (optional, default: null)
* @param pager FilterPager (optional, default: null)
* @return KalturaAppTokenListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('apptoken', 'list', kparams);
};
/**
* Starts a new KS (kaltura Session) based on an application authentication token ID.
* @param id string application token ID
* @param tokenHash string a hash [MD5, SHA1, SHA256 and SHA512 are supported] of the current KS concatenated with the application token
* @param userId string session user ID, will be ignored if a different user ID already defined on the application token (optional, default: null)
* @param type int session type, will be ignored if a different session type is already defined on the application token (optional, enum: KalturaSessionType, default: null)
* @param expiry int session expiry (in seconds), could be overridden by shorter expiry of the application token (optional, default: null)
* @param sessionPrivileges string session privileges, will be ignored if a similar privilege is already defined on the application token or the privilege is server reserved (optional, default: null)
* @return KalturaSessionInfo
*/
static startSession(id, tokenHash, userId = null, type = null, expiry = null, sessionPrivileges = null){
let kparams = {};
kparams.id = id;
kparams.tokenHash = tokenHash;
kparams.userId = userId;
kparams.type = type;
kparams.expiry = expiry;
kparams.sessionPrivileges = sessionPrivileges;
return new kaltura.RequestBuilder('apptoken', 'startSession', kparams);
};
/**
* Update application authentication token by ID.
* @param id string
* @param appToken AppToken
* @return KalturaAppToken
*/
static update(id, appToken){
let kparams = {};
kparams.id = id;
kparams.appToken = appToken;
return new kaltura.RequestBuilder('apptoken', 'update', kparams);
};
}
module.exports.appToken = appToken;
/**
*Class definition for the Kaltura service: baseEntry.
* The available service actions:
* @action add Generic add entry, should be used when the uploaded entry type is not known.
* @action addContent Attach content resource to entry in status NO_MEDIA.
* @action addFromUploadedFile Generic add entry using an uploaded file, should be used when the uploaded entry type is not known.
* @action anonymousRank Anonymously rank an entry, no validation is done on duplicate rankings.
* @action approve Approve the entry and mark the pending flags (if any) as moderated (this will make the entry playable).
* @action bulkDelete .
* @action clone Clone an entry with optional attributes to apply to the clone.
* @action count Count base entries by filter.
* @action delete Delete an entry.
* @action export .
* @action exportToCsv add batch job that sends an email with a link to download an updated CSV that contains list of entries.
* @action flag Flag inappropriate entry for moderation.
* @action get Get base entry by ID.
* @action getByIds Get an array of KalturaBaseEntry objects by a comma-separated list of ids.
* @action getContextData This action delivers entry-related data, based on the user's context: access control, restriction, playback format and storage information.
* @action getPlaybackContext This action delivers all data relevant for player.
* @action getRemotePaths Get remote storage existing paths for the asset.
* @action index Index an entry by id.
* @action list List base entries by filter with paging support.
* @action listByReferenceId List base entries by filter according to reference id.
* @action listFlags List all pending flags for the entry.
* @action recycle Move the entry to the recycle bin.
* @action reject Reject the entry and mark the pending flags (if any) as moderated (this will make the entry non-playable).
* @action restoreRecycled Restore the entry from the recycle bin.
* @action update Update base entry. Only the properties that were set will be updated.
* @action updateContent Update the content resource associated with the entry.
* @action updateThumbnailFromSourceEntry Update entry thumbnail from a different entry by a specified time offset (in seconds).
* @action updateThumbnailFromUrl Update entry thumbnail using URL.
* @action updateThumbnailJpeg Update entry thumbnail using a raw jpeg file.
* @action upload Upload a file to Kaltura, that can be used to create an entry.
*/
class baseEntry{
/**
* Generic add entry, should be used when the uploaded entry type is not known.
* @param entry BaseEntry
* @param type string (optional, enum: KalturaEntryType, default: null)
* @return KalturaBaseEntry
*/
static add(entry, type = null){
let kparams = {};
kparams.entry = entry;
kparams.type = type;
return new kaltura.RequestBuilder('baseentry', 'add', kparams);
};
/**
* Attach content resource to entry in status NO_MEDIA.
* @param entryId string
* @param resource Resource
* @return KalturaBaseEntry
*/
static addContent(entryId, resource){
let kparams = {};
kparams.entryId = entryId;
kparams.resource = resource;
return new kaltura.RequestBuilder('baseentry', 'addContent', kparams);
};
/**
* Generic add entry using an uploaded file, should be used when the uploaded entry type is not known.
* @param entry BaseEntry
* @param uploadTokenId string
* @param type string (optional, enum: KalturaEntryType, default: null)
* @return KalturaBaseEntry
*/
static addFromUploadedFile(entry, uploadTokenId, type = null){
let kparams = {};
kparams.entry = entry;
kparams.uploadTokenId = uploadTokenId;
kparams.type = type;
return new kaltura.RequestBuilder('baseentry', 'addFromUploadedFile', kparams);
};
/**
* Anonymously rank an entry, no validation is done on duplicate rankings.
* @param entryId string
* @param rank int
*/
static anonymousRank(entryId, rank){
let kparams = {};
kparams.entryId = entryId;
kparams.rank = rank;
return new kaltura.RequestBuilder('baseentry', 'anonymousRank', kparams);
};
/**
* Approve the entry and mark the pending flags (if any) as moderated (this will make the entry playable).
* @param entryId string
*/
static approve(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('baseentry', 'approve', kparams);
};
/**
* .
* @param filter BaseEntryFilter
* @return int
*/
static bulkDelete(filter){
let kparams = {};
kparams.filter = filter;
return new kaltura.RequestBuilder('baseentry', 'bulkDelete', kparams);
};
/**
* Clone an entry with optional attributes to apply to the clone.
* @param entryId string Id of entry to clone
* @param cloneOptions array (optional, default: null)
* @return KalturaBaseEntry
*/
static cloneAction(entryId, cloneOptions = null){
let kparams = {};
kparams.entryId = entryId;
kparams.cloneOptions = cloneOptions;
return new kaltura.RequestBuilder('baseentry', 'clone', kparams);
};
/**
* Count base entries by filter.
* @param filter BaseEntryFilter Entry filter (optional, default: null)
* @return int
*/
static count(filter = null){
let kparams = {};
kparams.filter = filter;
return new kaltura.RequestBuilder('baseentry', 'count', kparams);
};
/**
* Delete an entry.
* @param entryId string Entry id to delete
*/
static deleteAction(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('baseentry', 'delete', kparams);
};
/**
* .
* @param entryId string
* @param storageProfileId int
* @return KalturaBaseEntry
*/
static exportAction(entryId, storageProfileId){
let kparams = {};
kparams.entryId = entryId;
kparams.storageProfileId = storageProfileId;
return new kaltura.RequestBuilder('baseentry', 'export', kparams);
};
/**
* add batch job that sends an email with a link to download an updated CSV that contains list of entries.
* @param filter BaseEntryFilter A filter used to exclude specific entries (optional, default: null)
* @param metadataProfileId int (optional, default: null)
* @param additionalFields array (optional, default: null)
* @param mappedFields array mapping between field headline and its mapped value (optional, default: null)
* @param options ExportToCsvOptions (optional, default: null)
* @return string
*/
static exportToCsv(filter = null, metadataProfileId = null, additionalFields = null, mappedFields = null, options = null){
let kparams = {};
kparams.filter = filter;
kparams.metadataProfileId = metadataProfileId;
kparams.additionalFields = additionalFields;
kparams.mappedFields = mappedFields;
kparams.options = options;
return new kaltura.RequestBuilder('baseentry', 'exportToCsv', kparams);
};
/**
* Flag inappropriate entry for moderation.
* @param moderationFlag ModerationFlag
*/
static flag(moderationFlag){
let kparams = {};
kparams.moderationFlag = moderationFlag;
return new kaltura.RequestBuilder('baseentry', 'flag', kparams);
};
/**
* Get base entry by ID.
* @param entryId string Entry id
* @param version int Desired version of the data (optional, default: -1)
* @return KalturaBaseEntry
*/
static get(entryId, version = -1){
let kparams = {};
kparams.entryId = entryId;
kparams.version = version;
return new kaltura.RequestBuilder('baseentry', 'get', kparams);
};
/**
* Get an array of KalturaBaseEntry objects by a comma-separated list of ids.
* @param entryIds string Comma separated string of entry ids
* @return array
*/
static getByIds(entryIds){
let kparams = {};
kparams.entryIds = entryIds;
return new kaltura.RequestBuilder('baseentry', 'getByIds', kparams);
};
/**
* This action delivers entry-related data, based on the user's context: access control, restriction, playback format and storage information.
* @param entryId string
* @param contextDataParams EntryContextDataParams
* @return KalturaEntryContextDataResult
*/
static getContextData(entryId, contextDataParams){
let kparams = {};
kparams.entryId = entryId;
kparams.contextDataParams = contextDataParams;
return new kaltura.RequestBuilder('baseentry', 'getContextData', kparams);
};
/**
* This action delivers all data relevant for player.
* @param entryId string
* @param contextDataParams PlaybackContextOptions
* @return KalturaPlaybackContext
*/
static getPlaybackContext(entryId, contextDataParams){
let kparams = {};
kparams.entryId = entryId;
kparams.contextDataParams = contextDataParams;
return new kaltura.RequestBuilder('baseentry', 'getPlaybackContext', kparams);
};
/**
* Get remote storage existing paths for the asset.
* @param entryId string
* @return KalturaRemotePathListResponse
*/
static getRemotePaths(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('baseentry', 'getRemotePaths', kparams);
};
/**
* Index an entry by id.
* @param id string
* @param shouldUpdate bool (optional, default: true)
* @return int
*/
static index(id, shouldUpdate = true){
let kparams = {};
kparams.id = id;
kparams.shouldUpdate = shouldUpdate;
return new kaltura.RequestBuilder('baseentry', 'index', kparams);
};
/**
* List base entries by filter with paging support.
* @param filter BaseEntryFilter Entry filter (optional, default: null)
* @param pager FilterPager Pager (optional, default: null)
* @return KalturaBaseEntryListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('baseentry', 'list', kparams);
};
/**
* List base entries by filter according to reference id.
* @param refId string Entry Reference ID
* @param pager FilterPager Pager (optional, default: null)
* @return KalturaBaseEntryListResponse
*/
static listByReferenceId(refId, pager = null){
let kparams = {};
kparams.refId = refId;
kparams.pager = pager;
return new kaltura.RequestBuilder('baseentry', 'listByReferenceId', kparams);
};
/**
* List all pending flags for the entry.
* @param entryId string
* @param pager FilterPager (optional, default: null)
* @return KalturaModerationFlagListResponse
*/
static listFlags(entryId, pager = null){
let kparams = {};
kparams.entryId = entryId;
kparams.pager = pager;
return new kaltura.RequestBuilder('baseentry', 'listFlags', kparams);
};
/**
* Move the entry to the recycle bin.
* @param entryId string
* @return KalturaBaseEntry
*/
static recycle(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('baseentry', 'recycle', kparams);
};
/**
* Reject the entry and mark the pending flags (if any) as moderated (this will make the entry non-playable).
* @param entryId string
*/
static reject(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('baseentry', 'reject', kparams);
};
/**
* Restore the entry from the recycle bin.
* @param entryId string
* @return KalturaBaseEntry
*/
static restoreRecycled(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('baseentry', 'restoreRecycled', kparams);
};
/**
* Update base entry. Only the properties that were set will be updated.
* @param entryId string Entry id to update
* @param baseEntry BaseEntry Base entry metadata to update
* @return KalturaBaseEntry
*/
static update(entryId, baseEntry){
let kparams = {};
kparams.entryId = entryId;
kparams.baseEntry = baseEntry;
return new kaltura.RequestBuilder('baseentry', 'update', kparams);
};
/**
* Update the content resource associated with the entry.
* @param entryId string Entry id to update
* @param resource Resource Resource to be used to replace entry content
* @param conversionProfileId int The conversion profile id to be used on the entry (optional, default: null)
* @param advancedOptions EntryReplacementOptions Additional update content options (optional, default: null)
* @return KalturaBaseEntry
*/
static updateContent(entryId, resource, conversionProfileId = null, advancedOptions = null){
let kparams = {};
kparams.entryId = entryId;
kparams.resource = resource;
kparams.conversionProfileId = conversionProfileId;
kparams.advancedOptions = advancedOptions;
return new kaltura.RequestBuilder('baseentry', 'updateContent', kparams);
};
/**
* Update entry thumbnail from a different entry by a specified time offset (in seconds).
* @param entryId string Media entry id
* @param sourceEntryId string Media entry id
* @param timeOffset int Time offset (in seconds)
* @return KalturaBaseEntry
*/
static updateThumbnailFromSourceEntry(entryId, sourceEntryId, timeOffset){
let kparams = {};
kparams.entryId = entryId;
kparams.sourceEntryId = sourceEntryId;
kparams.timeOffset = timeOffset;
return new kaltura.RequestBuilder('baseentry', 'updateThumbnailFromSourceEntry', kparams);
};
/**
* Update entry thumbnail using URL.
* @param entryId string Media entry id
* @param url string file url
* @return KalturaBaseEntry
*/
static updateThumbnailFromUrl(entryId, url){
let kparams = {};
kparams.entryId = entryId;
kparams.url = url;
return new kaltura.RequestBuilder('baseentry', 'updateThumbnailFromUrl', kparams);
};
/**
* Update entry thumbnail using a raw jpeg file.
* @param entryId string Media entry id
* @param fileData file Jpeg file data
* @return KalturaBaseEntry
*/
static updateThumbnailJpeg(entryId, fileData){
let kparams = {};
kparams.entryId = entryId;
let kfiles = {};
kfiles.fileData = fileData;
return new kaltura.RequestBuilder('baseentry', 'updateThumbnailJpeg', kparams, kfiles);
};
/**
* Upload a file to Kaltura, that can be used to create an entry.
* @param fileData file The file data
* @return string
*/
static upload(fileData){
let kparams = {};
let kfiles = {};
kfiles.fileData = fileData;
return new kaltura.RequestBuilder('baseentry', 'upload', kparams, kfiles);
};
}
module.exports.baseEntry = baseEntry;
/**
*Class definition for the Kaltura service: bulkUpload.
* The available service actions:
* @action abort Aborts the bulk upload and all its child jobs.
* @action add Add new bulk upload batch job
* Conversion profile id can be specified in the API or in the CSV file, the one in the CSV file will be stronger.
* If no conversion profile was specified, partner's default will be used.
* @action get Get bulk upload batch job by id.
* @action list List bulk upload batch jobs.
*/
class bulkUpload{
/**
* Aborts the bulk upload and all its child jobs.
* @param id int job id
* @return KalturaBulkUpload
*/
static abort(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('bulkupload', 'abort', kparams);
};
/**
* Add new bulk upload batch job
* Conversion profile id can be specified in the API or in the CSV file, the one in the CSV file will be stronger.
* If no conversion profile was specified, partner's default will be used.
* @param conversionProfileId int Conversion profile id to use for converting the current bulk (-1 to use partner's default)
* @param csvFileData file bulk upload file
* @param bulkUploadType string (optional, enum: KalturaBulkUploadType, default: null)
* @param uploadedBy string (optional, default: null)
* @param fileName string Friendly name of the file, used to be recognized later in the logs (optional, default: null)
* @return KalturaBulkUpload
*/
static add(conversionProfileId, csvFileData, bulkUploadType = null, uploadedBy = null, fileName = null){
let kparams = {};
kparams.conversionProfileId = conversionProfileId;
let kfiles = {};
kfiles.csvFileData = csvFileData;
kparams.bulkUploadType = bulkUploadType;
kparams.uploadedBy = uploadedBy;
kparams.fileName = fileName;
return new kaltura.RequestBuilder('bulkupload', 'add', kparams, kfiles);
};
/**
* Get bulk upload batch job by id.
* @param id int
* @return KalturaBulkUpload
*/
static get(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('bulkupload', 'get', kparams);
};
/**
* List bulk upload batch jobs.
* @param pager FilterPager (optional, default: null)
* @return KalturaBulkUploadListResponse
*/
static listAction(pager = null){
let kparams = {};
kparams.pager = pager;
return new kaltura.RequestBuilder('bulkupload', 'list', kparams);
};
}
module.exports.bulkUpload = bulkUpload;
/**
*Class definition for the Kaltura service: categoryEntry.
* The available service actions:
* @action activate activate CategoryEntry when it is pending moderation.
* @action add Add new CategoryEntry.
* @action addFromBulkUpload .
* @action delete Delete CategoryEntry.
* @action index Index CategoryEntry by Id.
* @action list List all categoryEntry.
* @action reject activate CategoryEntry when it is pending moderation.
* @action syncPrivacyContext update privacy context from the category.
* @action updateStatusFromBulk .
*/
class categoryEntry{
/**
* activate CategoryEntry when it is pending moderation.
* @param entryId string
* @param categoryId int
*/
static activate(entryId, categoryId){
let kparams = {};
kparams.entryId = entryId;
kparams.categoryId = categoryId;
return new kaltura.RequestBuilder('categoryentry', 'activate', kparams);
};
/**
* Add new CategoryEntry.
* @param categoryEntry CategoryEntry
* @return KalturaCategoryEntry
*/
static add(categoryEntry){
let kparams = {};
kparams.categoryEntry = categoryEntry;
return new kaltura.RequestBuilder('categoryentry', 'add', kparams);
};
/**
* .
* @param bulkUploadData BulkServiceData
* @param bulkUploadCategoryEntryData BulkUploadCategoryEntryData (optional, default: null)
* @return KalturaBulkUpload
*/
static addFromBulkUpload(bulkUploadData, bulkUploadCategoryEntryData = null){
let kparams = {};
kparams.bulkUploadData = bulkUploadData;
kparams.bulkUploadCategoryEntryData = bulkUploadCategoryEntryData;
return new kaltura.RequestBuilder('categoryentry', 'addFromBulkUpload', kparams);
};
/**
* Delete CategoryEntry.
* @param entryId string
* @param categoryId int
*/
static deleteAction(entryId, categoryId){
let kparams = {};
kparams.entryId = entryId;
kparams.categoryId = categoryId;
return new kaltura.RequestBuilder('categoryentry', 'delete', kparams);
};
/**
* Index CategoryEntry by Id.
* @param entryId string
* @param categoryId int
* @param shouldUpdate bool (optional, default: true)
* @return int
*/
static index(entryId, categoryId, shouldUpdate = true){
let kparams = {};
kparams.entryId = entryId;
kparams.categoryId = categoryId;
kparams.shouldUpdate = shouldUpdate;
return new kaltura.RequestBuilder('categoryentry', 'index', kparams);
};
/**
* List all categoryEntry.
* @param filter CategoryEntryFilter (optional, default: null)
* @param pager FilterPager (optional, default: null)
* @return KalturaCategoryEntryListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('categoryentry', 'list', kparams);
};
/**
* activate CategoryEntry when it is pending moderation.
* @param entryId string
* @param categoryId int
*/
static reject(entryId, categoryId){
let kparams = {};
kparams.entryId = entryId;
kparams.categoryId = categoryId;
return new kaltura.RequestBuilder('categoryentry', 'reject', kparams);
};
/**
* update privacy context from the category.
* @param entryId string
* @param categoryId int
*/
static syncPrivacyContext(entryId, categoryId){
let kparams = {};
kparams.entryId = entryId;
kparams.categoryId = categoryId;
return new kaltura.RequestBuilder('categoryentry', 'syncPrivacyContext', kparams);
};
/**
* .
* @param fileData file
* @param bulkUploadData BulkUploadJobData (optional, default: null)
* @param bulkUploadCategoryEntryData BulkUploadCategoryEntryData (optional, default: null)
* @return KalturaBulkUpload
*/
static updateStatusFromBulk(fileData, bulkUploadData = null, bulkUploadCategoryEntryData = null){
let kparams = {};
let kfiles = {};
kfiles.fileData = fileData;
kparams.bulkUploadData = bulkUploadData;
kparams.bulkUploadCategoryEntryData = bulkUploadCategoryEntryData;
return new kaltura.RequestBuilder('categoryentry', 'updateStatusFromBulk', kparams, kfiles);
};
}
module.exports.categoryEntry = categoryEntry;
/**
*Class definition for the Kaltura service: category.
* The available service actions:
* @action add Add new Category.
* @action addFromBulkUpload .
* @action clone Clone Category.
* @action delete Delete a Category.
* @action exportToCsv Creates a batch job that sends an email with a link to download a CSV containing a list of categories.
* @action get Get Category by id.
* @action index Index Category by id.
* @action list List all categories.
* @action move Move categories that belong to the same parent category to a target category - enabled only for ks with disable entitlement.
* @action unlockCategories Unlock categories.
* @action update Update Category.
*/
class category{
/**
* Add new Category.
* @param category Category
* @return KalturaCategory
*/
static add(category){
let kparams = {};
kparams.category = category;
return new kaltura.RequestBuilder('category', 'add', kparams);
};
/**
* .
* @param fileData file
* @param bulkUploadData BulkUploadJobData (optional, default: null)
* @param bulkUploadCategoryData BulkUploadCategoryData (optional, default: null)
* @return KalturaBulkUpload
*/
static addFromBulkUpload(fileData, bulkUploadData = null, bulkUploadCategoryData = null){
let kparams = {};
let kfiles = {};
kfiles.fileData = fileData;
kparams.bulkUploadData = bulkUploadData;
kparams.bulkUploadCategoryData = bulkUploadCategoryData;
return new kaltura.RequestBuilder('category', 'addFromBulkUpload', kparams, kfiles);
};
/**
* Clone Category.
* @param categoryId int
* @param fromPartnerId int
* @param parentCategoryId int (optional, default: null)
* @return KalturaCategory
*/
static cloneAction(categoryId, fromPartnerId, parentCategoryId = null){
let kparams = {};
kparams.categoryId = categoryId;
kparams.fromPartnerId = fromPartnerId;
kparams.parentCategoryId = parentCategoryId;
return new kaltura.RequestBuilder('category', 'clone', kparams);
};
/**
* Delete a Category.
* @param id int
* @param moveEntriesToParentCategory int (optional, enum: KalturaNullableBoolean, default: 1)
*/
static deleteAction(id, moveEntriesToParentCategory = 1){
let kparams = {};
kparams.id = id;
kparams.moveEntriesToParentCategory = moveEntriesToParentCategory;
return new kaltura.RequestBuilder('category', 'delete', kparams);
};
/**
* Creates a batch job that sends an email with a link to download a CSV containing a list of categories.
* @param filter CategoryFilter A filter used to exclude specific categories (optional, default: null)
* @param metadataProfileId int (optional, default: null)
* @param additionalFields array (optional, default: null)
* @param mappedFields array mapping between field headline and its mapped value (optional, default: null)
* @param options ExportToCsvOptions (optional, default: null)
* @return string
*/
static exportToCsv(filter = null, metadataProfileId = null, additionalFields = null, mappedFields = null, options = null){
let kparams = {};
kparams.filter = filter;
kparams.metadataProfileId = metadataProfileId;
kparams.additionalFields = additionalFields;
kparams.mappedFields = mappedFields;
kparams.options = options;
return new kaltura.RequestBuilder('category', 'exportToCsv', kparams);
};
/**
* Get Category by id.
* @param id int
* @return KalturaCategory
*/
static get(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('category', 'get', kparams);
};
/**
* Index Category by id.
* @param id int
* @param shouldUpdate bool (optional, default: true)
* @return int
*/
static index(id, shouldUpdate = true){
let kparams = {};
kparams.id = id;
kparams.shouldUpdate = shouldUpdate;
return new kaltura.RequestBuilder('category', 'index', kparams);
};
/**
* List all categories.
* @param filter CategoryFilter (optional, default: null)
* @param pager FilterPager (optional, default: null)
* @return KalturaCategoryListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('category', 'list', kparams);
};
/**
* Move categories that belong to the same parent category to a target category - enabled only for ks with disable entitlement.
* @param categoryIds string
* @param targetCategoryParentId int
* @return bool
*/
static move(categoryIds, targetCategoryParentId){
let kparams = {};
kparams.categoryIds = categoryIds;
kparams.targetCategoryParentId = targetCategoryParentId;
return new kaltura.RequestBuilder('category', 'move', kparams);
};
/**
* Unlock categories.
*/
static unlockCategories(){
let kparams = {};
return new kaltura.RequestBuilder('category', 'unlockCategories', kparams);
};
/**
* Update Category.
* @param id int
* @param category Category
* @return KalturaCategory
*/
static update(id, category){
let kparams = {};
kparams.id = id;
kparams.category = category;
return new kaltura.RequestBuilder('category', 'update', kparams);
};
}
module.exports.category = category;
/**
*Class definition for the Kaltura service: categoryUser.
* The available service actions:
* @action activate activate CategoryUser.
* @action add Add new CategoryUser.
* @action addFromBulkUpload .
* @action copyFromCategory Copy all member from parent category.
* @action deactivate reject CategoryUser.
* @action delete Delete a CategoryUser.
* @action get Get CategoryUser by id.
* @action index Index CategoryUser by userid and category id.
* @action list List all categories.
* @action update Update CategoryUser by id.
*/
class categoryUser{
/**
* activate CategoryUser.
* @param categoryId int
* @param userId string
* @return KalturaCategoryUser
*/
static activate(categoryId, userId){
let kparams = {};
kparams.categoryId = categoryId;
kparams.userId = userId;
return new kaltura.RequestBuilder('categoryuser', 'activate', kparams);
};
/**
* Add new CategoryUser.
* @param categoryUser CategoryUser
* @return KalturaCategoryUser
*/
static add(categoryUser){
let kparams = {};
kparams.categoryUser = categoryUser;
return new kaltura.RequestBuilder('categoryuser', 'add', kparams);
};
/**
* .
* @param fileData file
* @param bulkUploadData BulkUploadJobData (optional, default: null)
* @param bulkUploadCategoryUserData BulkUploadCategoryUserData (optional, default: null)
* @return KalturaBulkUpload
*/
static addFromBulkUpload(fileData, bulkUploadData = null, bulkUploadCategoryUserData = null){
let kparams = {};
let kfiles = {};
kfiles.fileData = fileData;
kparams.bulkUploadData = bulkUploadData;
kparams.bulkUploadCategoryUserData = bulkUploadCategoryUserData;
return new kaltura.RequestBuilder('categoryuser', 'addFromBulkUpload', kparams, kfiles);
};
/**
* Copy all member from parent category.
* @param categoryId int
*/
static copyFromCategory(categoryId){
let kparams = {};
kparams.categoryId = categoryId;
return new kaltura.RequestBuilder('categoryuser', 'copyFromCategory', kparams);
};
/**
* reject CategoryUser.
* @param categoryId int
* @param userId string
* @return KalturaCategoryUser
*/
static deactivate(categoryId, userId){
let kparams = {};
kparams.categoryId = categoryId;
kparams.userId = userId;
return new kaltura.RequestBuilder('categoryuser', 'deactivate', kparams);
};
/**
* Delete a CategoryUser.
* @param categoryId int
* @param userId string
*/
static deleteAction(categoryId, userId){
let kparams = {};
kparams.categoryId = categoryId;
kparams.userId = userId;
return new kaltura.RequestBuilder('categoryuser', 'delete', kparams);
};
/**
* Get CategoryUser by id.
* @param categoryId int
* @param userId string
* @return KalturaCategoryUser
*/
static get(categoryId, userId){
let kparams = {};
kparams.categoryId = categoryId;
kparams.userId = userId;
return new kaltura.RequestBuilder('categoryuser', 'get', kparams);
};
/**
* Index CategoryUser by userid and category id.
* @param userId string
* @param categoryId int
* @param shouldUpdate bool (optional, default: true)
* @return int
*/
static index(userId, categoryId, shouldUpdate = true){
let kparams = {};
kparams.userId = userId;
kparams.categoryId = categoryId;
kparams.shouldUpdate = shouldUpdate;
return new kaltura.RequestBuilder('categoryuser', 'index', kparams);
};
/**
* List all categories.
* @param filter CategoryUserFilter (optional, default: null)
* @param pager FilterPager (optional, default: null)
* @return KalturaCategoryUserListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('categoryuser', 'list', kparams);
};
/**
* Update CategoryUser by id.
* @param categoryId int
* @param userId string
* @param categoryUser CategoryUser
* @param override bool - to override manual changes (optional, default: false)
* @return KalturaCategoryUser
*/
static update(categoryId, userId, categoryUser, override = false){
let kparams = {};
kparams.categoryId = categoryId;
kparams.userId = userId;
kparams.categoryUser = categoryUser;
kparams.override = override;
return new kaltura.RequestBuilder('categoryuser', 'update', kparams);
};
}
module.exports.categoryUser = categoryUser;
/**
*Class definition for the Kaltura service: conversionProfileAssetParams.
* The available service actions:
* @action list Lists asset parmas of conversion profile by ID.
* @action update Update asset parmas of conversion profile by ID.
*/
class conversionProfileAssetParams{
/**
* Lists asset parmas of conversion profile by ID.
* @param filter ConversionProfileAssetParamsFilter (optional, default: null)
* @param pager FilterPager (optional, default: null)
* @return KalturaConversionProfileAssetParamsListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('conversionprofileassetparams', 'list', kparams);
};
/**
* Update asset parmas of conversion profile by ID.
* @param conversionProfileId int
* @param assetParamsId int
* @param conversionProfileAssetParams ConversionProfileAssetParams
* @return KalturaConversionProfileAssetParams
*/
static update(conversionProfileId, assetParamsId, conversionProfileAssetParams){
let kparams = {};
kparams.conversionProfileId = conversionProfileId;
kparams.assetParamsId = assetParamsId;
kparams.conversionProfileAssetParams = conversionProfileAssetParams;
return new kaltura.RequestBuilder('conversionprofileassetparams', 'update', kparams);
};
}
module.exports.conversionProfileAssetParams = conversionProfileAssetParams;
/**
*Class definition for the Kaltura service: conversionProfile.
* The available service actions:
* @action add Add new Conversion Profile.
* @action delete Delete Conversion Profile by ID.
* @action get Get Conversion Profile by ID.
* @action getDefault Get the partner's default conversion profile.
* @action list List Conversion Profiles by filter with paging support.
* @action setAsDefault Set Conversion Profile to be the partner default.
* @action update Update Conversion Profile by ID.
*/
class conversionProfile{
/**
* Add new Conversion Profile.
* @param conversionProfile ConversionProfile
* @return KalturaConversionProfile
*/
static add(conversionProfile){
let kparams = {};
kparams.conversionProfile = conversionProfile;
return new kaltura.RequestBuilder('conversionprofile', 'add', kparams);
};
/**
* Delete Conversion Profile by ID.
* @param id int
*/
static deleteAction(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('conversionprofile', 'delete', kparams);
};
/**
* Get Conversion Profile by ID.
* @param id int
* @return KalturaConversionProfile
*/
static get(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('conversionprofile', 'get', kparams);
};
/**
* Get the partner's default conversion profile.
* @param type string (optional, enum: KalturaConversionProfileType, default: null)
* @return KalturaConversionProfile
*/
static getDefault(type = null){
let kparams = {};
kparams.type = type;
return new kaltura.RequestBuilder('conversionprofile', 'getDefault', kparams);
};
/**
* List Conversion Profiles by filter with paging support.
* @param filter ConversionProfileFilter (optional, default: null)
* @param pager FilterPager (optional, default: null)
* @return KalturaConversionProfileListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('conversionprofile', 'list', kparams);
};
/**
* Set Conversion Profile to be the partner default.
* @param id int
* @return KalturaConversionProfile
*/
static setAsDefault(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('conversionprofile', 'setAsDefault', kparams);
};
/**
* Update Conversion Profile by ID.
* @param id int
* @param conversionProfile ConversionProfile
* @return KalturaConversionProfile
*/
static update(id, conversionProfile){
let kparams = {};
kparams.id = id;
kparams.conversionProfile = conversionProfile;
return new kaltura.RequestBuilder('conversionprofile', 'update', kparams);
};
}
module.exports.conversionProfile = conversionProfile;
/**
*Class definition for the Kaltura service: data.
* The available service actions:
* @action add Adds a new data entry.
* @action addContent Update the dataContent of data entry using a resource.
* @action delete Delete a data entry.
* @action get Get data entry by ID.
* @action list List data entries by filter with paging support.
* @action update Update data entry. Only the properties that were set will be updated.
*/
class data{
/**
* Adds a new data entry.
* @param dataEntry DataEntry Data entry
* @return KalturaDataEntry
*/
static add(dataEntry){
let kparams = {};
kparams.dataEntry = dataEntry;
return new kaltura.RequestBuilder('data', 'add', kparams);
};
/**
* Update the dataContent of data entry using a resource.
* @param entryId string
* @param resource GenericDataCenterContentResource
* @return string
*/
static addContent(entryId, resource){
let kparams = {};
kparams.entryId = entryId;
kparams.resource = resource;
return new kaltura.RequestBuilder('data', 'addContent', kparams);
};
/**
* Delete a data entry.
* @param entryId string Data entry id to delete
*/
static deleteAction(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('data', 'delete', kparams);
};
/**
* Get data entry by ID.
* @param entryId string Data entry id
* @param version int Desired version of the data (optional, default: -1)
* @return KalturaDataEntry
*/
static get(entryId, version = -1){
let kparams = {};
kparams.entryId = entryId;
kparams.version = version;
return new kaltura.RequestBuilder('data', 'get', kparams);
};
/**
* List data entries by filter with paging support.
* @param filter DataEntryFilter Document entry filter (optional, default: null)
* @param pager FilterPager Pager (optional, default: null)
* @return KalturaDataListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('data', 'list', kparams);
};
/**
* Update data entry. Only the properties that were set will be updated.
* @param entryId string Data entry id to update
* @param documentEntry DataEntry Data entry metadata to update
* @return KalturaDataEntry
*/
static update(entryId, documentEntry){
let kparams = {};
kparams.entryId = entryId;
kparams.documentEntry = documentEntry;
return new kaltura.RequestBuilder('data', 'update', kparams);
};
}
module.exports.data = data;
/**
*Class definition for the Kaltura service: deliveryProfile.
* The available service actions:
* @action add Add new delivery.
* @action clone Add delivery based on existing delivery.
* Must provide valid sourceDeliveryId.
* @action get Get delivery by id.
* @action list Retrieve a list of available delivery depends on the filter given.
* @action update Update existing delivery profile.
*/
class deliveryProfile{
/**
* Add new delivery.
* @param delivery DeliveryProfile
* @return KalturaDeliveryProfile
*/
static add(delivery){
let kparams = {};
kparams.delivery = delivery;
return new kaltura.RequestBuilder('deliveryprofile', 'add', kparams);
};
/**
* Add delivery based on existing delivery.
* Must provide valid sourceDeliveryId.
* @param deliveryId int
* @return KalturaDeliveryProfile
*/
static cloneAction(deliveryId){
let kparams = {};
kparams.deliveryId = deliveryId;
return new kaltura.RequestBuilder('deliveryprofile', 'clone', kparams);
}