purecloud-platform-client-v2
Version:
A JavaScript library to interface with the PureCloud Platform API
1,246 lines (1,154 loc) • 93 kB
JavaScript
import ApiClient from '../ApiClient.js';
class GamificationApi {
/**
* Gamification service.
* @module purecloud-platform-client-v2/api/GamificationApi
* @version 223.0.0
*/
/**
* Constructs a new GamificationApi.
* @alias module:purecloud-platform-client-v2/api/GamificationApi
* @class
* @param {module:purecloud-platform-client-v2/ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:purecloud-platform-client-v2/ApiClient#instance} if unspecified.
*/
constructor(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
}
/**
* Delete an External Metric Definition
*
* @param {String} metricId Specifies the External Metric Definition ID
*/
deleteEmployeeperformanceExternalmetricsDefinition(metricId) {
// verify the required parameter 'metricId' is set
if (metricId === undefined || metricId === null) {
throw 'Missing the required parameter "metricId" when calling deleteEmployeeperformanceExternalmetricsDefinition';
}
return this.apiClient.callApi(
'/api/v2/employeeperformance/externalmetrics/definitions/{metricId}',
'DELETE',
{ 'metricId': metricId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Delete a Contest by Id
*
* @param {String} contestId The ID of the contest
*/
deleteGamificationContest(contestId) {
// verify the required parameter 'contestId' is set
if (contestId === undefined || contestId === null) {
throw 'Missing the required parameter "contestId" when calling deleteGamificationContest';
}
return this.apiClient.callApi(
'/api/v2/gamification/contests/{contestId}',
'DELETE',
{ 'contestId': contestId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get an External Metric Definition
*
* @param {String} metricId Specifies the External Metric Definition ID
*/
getEmployeeperformanceExternalmetricsDefinition(metricId) {
// verify the required parameter 'metricId' is set
if (metricId === undefined || metricId === null) {
throw 'Missing the required parameter "metricId" when calling getEmployeeperformanceExternalmetricsDefinition';
}
return this.apiClient.callApi(
'/api/v2/employeeperformance/externalmetrics/definitions/{metricId}',
'GET',
{ 'metricId': metricId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get a list of External Metric Definitions of an organization, sorted by name in ascending order
*
* @param {Object} opts Optional parameters
* @param {Number} opts.pageSize Page size (default to 25)
* @param {Number} opts.pageNumber Page number (default to 1)
*/
getEmployeeperformanceExternalmetricsDefinitions(opts) {
opts = opts || {};
return this.apiClient.callApi(
'/api/v2/employeeperformance/externalmetrics/definitions',
'GET',
{ },
{ 'pageSize': opts['pageSize'],'pageNumber': opts['pageNumber'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get a Contest by Id
*
* @param {String} contestId The ID of the contest
*/
getGamificationContest(contestId) {
// verify the required parameter 'contestId' is set
if (contestId === undefined || contestId === null) {
throw 'Missing the required parameter "contestId" when calling getGamificationContest';
}
return this.apiClient.callApi(
'/api/v2/gamification/contests/{contestId}',
'GET',
{ 'contestId': contestId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get Contest Scores (Admin)
*
* @param {String} contestId The ID of the contest
* @param {Object} opts Optional parameters
* @param {Number} opts.pageNumber (default to 1)
* @param {Number} opts.pageSize (default to 25)
* @param {String} opts.workday Target querying workday. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {Object} opts.returnsView Desired response results (default to All)
*/
getGamificationContestAgentsScores(contestId, opts) {
opts = opts || {};
// verify the required parameter 'contestId' is set
if (contestId === undefined || contestId === null) {
throw 'Missing the required parameter "contestId" when calling getGamificationContestAgentsScores';
}
return this.apiClient.callApi(
'/api/v2/gamification/contests/{contestId}/agents/scores',
'GET',
{ 'contestId': contestId },
{ 'pageNumber': opts['pageNumber'],'pageSize': opts['pageSize'],'workday': opts['workday'],'returnsView': opts['returnsView'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get Contest Scores for the requesting Agent/Supervisor
*
* @param {String} contestId The ID of the contest
* @param {Object} opts Optional parameters
* @param {Number} opts.pageNumber (default to 1)
* @param {Number} opts.pageSize (default to 25)
* @param {String} opts.workday Target querying workday. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {Object} opts.returnsView Desired response results (Supervisor Only) (default to All)
*/
getGamificationContestAgentsScoresMe(contestId, opts) {
opts = opts || {};
// verify the required parameter 'contestId' is set
if (contestId === undefined || contestId === null) {
throw 'Missing the required parameter "contestId" when calling getGamificationContestAgentsScoresMe';
}
return this.apiClient.callApi(
'/api/v2/gamification/contests/{contestId}/agents/scores/me',
'GET',
{ 'contestId': contestId },
{ 'pageNumber': opts['pageNumber'],'pageSize': opts['pageSize'],'workday': opts['workday'],'returnsView': opts['returnsView'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get a Contest Score Trend (Average Trend)
*
* @param {String} contestId The ID of the contest
*/
getGamificationContestAgentsScoresTrends(contestId) {
// verify the required parameter 'contestId' is set
if (contestId === undefined || contestId === null) {
throw 'Missing the required parameter "contestId" when calling getGamificationContestAgentsScoresTrends';
}
return this.apiClient.callApi(
'/api/v2/gamification/contests/{contestId}/agents/scores/trends',
'GET',
{ 'contestId': contestId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get a Contest Score Trend for the requesting Agent
*
* @param {String} contestId The ID of the contest
*/
getGamificationContestAgentsScoresTrendsMe(contestId) {
// verify the required parameter 'contestId' is set
if (contestId === undefined || contestId === null) {
throw 'Missing the required parameter "contestId" when calling getGamificationContestAgentsScoresTrendsMe';
}
return this.apiClient.callApi(
'/api/v2/gamification/contests/{contestId}/agents/scores/trends/me',
'GET',
{ 'contestId': contestId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get a Contest Prize Image by Id
*
* @param {String} contestId The ID of the contest
* @param {String} prizeImageId The ID of the prize image
*/
getGamificationContestPrizeimage(contestId, prizeImageId) {
// verify the required parameter 'contestId' is set
if (contestId === undefined || contestId === null) {
throw 'Missing the required parameter "contestId" when calling getGamificationContestPrizeimage';
}
// verify the required parameter 'prizeImageId' is set
if (prizeImageId === undefined || prizeImageId === null) {
throw 'Missing the required parameter "prizeImageId" when calling getGamificationContestPrizeimage';
}
return this.apiClient.callApi(
'/api/v2/gamification/contests/{contestId}/prizeimages/{prizeImageId}',
'GET',
{ 'contestId': contestId,'prizeImageId': prizeImageId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get a List of Contests (Admin)
*
* @param {Object} opts Optional parameters
* @param {Number} opts.pageNumber (default to 1)
* @param {Number} opts.pageSize (default to 25)
* @param {String} opts.dateStart Start date for the query. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} opts.dateEnd End date for the query. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {Array.<String>} opts.status
* @param {Object} opts.sortBy (default to dateStart)
* @param {Object} opts.sortOrder (default to desc)
*/
getGamificationContests(opts) {
opts = opts || {};
return this.apiClient.callApi(
'/api/v2/gamification/contests',
'GET',
{ },
{ 'pageNumber': opts['pageNumber'],'pageSize': opts['pageSize'],'dateStart': opts['dateStart'],'dateEnd': opts['dateEnd'],'status': this.apiClient.buildCollectionParam(opts['status'], 'multi'),'sortBy': opts['sortBy'],'sortOrder': opts['sortOrder'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get a List of Contests (Agent/Supervisor)
*
* @param {Object} opts Optional parameters
* @param {Number} opts.pageNumber (default to 1)
* @param {Number} opts.pageSize (default to 25)
* @param {String} opts.dateStart Start date for the query. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} opts.dateEnd End date for the query. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {Array.<String>} opts.status
* @param {Object} opts.sortBy (default to dateStart)
* @param {Object} opts.sortOrder (default to desc)
* @param {Object} opts.view (default to participant)
*/
getGamificationContestsMe(opts) {
opts = opts || {};
return this.apiClient.callApi(
'/api/v2/gamification/contests/me',
'GET',
{ },
{ 'pageNumber': opts['pageNumber'],'pageSize': opts['pageSize'],'dateStart': opts['dateStart'],'dateEnd': opts['dateEnd'],'status': this.apiClient.buildCollectionParam(opts['status'], 'multi'),'sortBy': opts['sortBy'],'sortOrder': opts['sortOrder'],'view': opts['view'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get insights summary
*
* @param {Object} filterType Filter type for the query request.
* @param {String} filterId ID for the filter type.
* @param {Object} granularity Granularity
* @param {String} comparativePeriodStartWorkday The start work day of comparative period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} primaryPeriodStartWorkday The start work day of primary period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {Object} opts Optional parameters
* @param {Number} opts.pageSize Page size (default to 25)
* @param {Number} opts.pageNumber Page number (default to 1)
* @param {Object} opts.sortKey Sort key
* @param {String} opts.sortMetricId Sort Metric Id
* @param {Object} opts.sortOrder Sort order (default to asc)
* @param {String} opts.userIds A list of up to 100 comma-separated user Ids
*/
getGamificationInsights(filterType, filterId, granularity, comparativePeriodStartWorkday, primaryPeriodStartWorkday, opts) {
opts = opts || {};
// verify the required parameter 'filterType' is set
if (filterType === undefined || filterType === null) {
throw 'Missing the required parameter "filterType" when calling getGamificationInsights';
}
// verify the required parameter 'filterId' is set
if (filterId === undefined || filterId === null) {
throw 'Missing the required parameter "filterId" when calling getGamificationInsights';
}
// verify the required parameter 'granularity' is set
if (granularity === undefined || granularity === null) {
throw 'Missing the required parameter "granularity" when calling getGamificationInsights';
}
// verify the required parameter 'comparativePeriodStartWorkday' is set
if (comparativePeriodStartWorkday === undefined || comparativePeriodStartWorkday === null) {
throw 'Missing the required parameter "comparativePeriodStartWorkday" when calling getGamificationInsights';
}
// verify the required parameter 'primaryPeriodStartWorkday' is set
if (primaryPeriodStartWorkday === undefined || primaryPeriodStartWorkday === null) {
throw 'Missing the required parameter "primaryPeriodStartWorkday" when calling getGamificationInsights';
}
return this.apiClient.callApi(
'/api/v2/gamification/insights',
'GET',
{ },
{ 'filterType': filterType,'filterId': filterId,'granularity': granularity,'comparativePeriodStartWorkday': comparativePeriodStartWorkday,'primaryPeriodStartWorkday': primaryPeriodStartWorkday,'pageSize': opts['pageSize'],'pageNumber': opts['pageNumber'],'sortKey': opts['sortKey'],'sortMetricId': opts['sortMetricId'],'sortOrder': opts['sortOrder'],'userIds': opts['userIds'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get insights details for the current user
*
* @param {Object} filterType Filter type for the query request.
* @param {String} filterId ID for the filter type.
* @param {Object} granularity Granularity
* @param {String} comparativePeriodStartWorkday The start work day of comparative period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} primaryPeriodStartWorkday The start work day of primary period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
*/
getGamificationInsightsDetails(filterType, filterId, granularity, comparativePeriodStartWorkday, primaryPeriodStartWorkday) {
// verify the required parameter 'filterType' is set
if (filterType === undefined || filterType === null) {
throw 'Missing the required parameter "filterType" when calling getGamificationInsightsDetails';
}
// verify the required parameter 'filterId' is set
if (filterId === undefined || filterId === null) {
throw 'Missing the required parameter "filterId" when calling getGamificationInsightsDetails';
}
// verify the required parameter 'granularity' is set
if (granularity === undefined || granularity === null) {
throw 'Missing the required parameter "granularity" when calling getGamificationInsightsDetails';
}
// verify the required parameter 'comparativePeriodStartWorkday' is set
if (comparativePeriodStartWorkday === undefined || comparativePeriodStartWorkday === null) {
throw 'Missing the required parameter "comparativePeriodStartWorkday" when calling getGamificationInsightsDetails';
}
// verify the required parameter 'primaryPeriodStartWorkday' is set
if (primaryPeriodStartWorkday === undefined || primaryPeriodStartWorkday === null) {
throw 'Missing the required parameter "primaryPeriodStartWorkday" when calling getGamificationInsightsDetails';
}
return this.apiClient.callApi(
'/api/v2/gamification/insights/details',
'GET',
{ },
{ 'filterType': filterType,'filterId': filterId,'granularity': granularity,'comparativePeriodStartWorkday': comparativePeriodStartWorkday,'primaryPeriodStartWorkday': primaryPeriodStartWorkday },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get insights overall trend for the current user
*
* @param {Object} filterType Filter type for the query request.
* @param {String} filterId ID for the filter type.
* @param {Object} granularity Granularity
* @param {String} comparativePeriodStartWorkday The start work day of comparative period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} comparativePeriodEndWorkday The end work day of comparative period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} primaryPeriodStartWorkday The start work day of primary period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} primaryPeriodEndWorkday The end work day of primary period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
*/
getGamificationInsightsGroupsTrends(filterType, filterId, granularity, comparativePeriodStartWorkday, comparativePeriodEndWorkday, primaryPeriodStartWorkday, primaryPeriodEndWorkday) {
// verify the required parameter 'filterType' is set
if (filterType === undefined || filterType === null) {
throw 'Missing the required parameter "filterType" when calling getGamificationInsightsGroupsTrends';
}
// verify the required parameter 'filterId' is set
if (filterId === undefined || filterId === null) {
throw 'Missing the required parameter "filterId" when calling getGamificationInsightsGroupsTrends';
}
// verify the required parameter 'granularity' is set
if (granularity === undefined || granularity === null) {
throw 'Missing the required parameter "granularity" when calling getGamificationInsightsGroupsTrends';
}
// verify the required parameter 'comparativePeriodStartWorkday' is set
if (comparativePeriodStartWorkday === undefined || comparativePeriodStartWorkday === null) {
throw 'Missing the required parameter "comparativePeriodStartWorkday" when calling getGamificationInsightsGroupsTrends';
}
// verify the required parameter 'comparativePeriodEndWorkday' is set
if (comparativePeriodEndWorkday === undefined || comparativePeriodEndWorkday === null) {
throw 'Missing the required parameter "comparativePeriodEndWorkday" when calling getGamificationInsightsGroupsTrends';
}
// verify the required parameter 'primaryPeriodStartWorkday' is set
if (primaryPeriodStartWorkday === undefined || primaryPeriodStartWorkday === null) {
throw 'Missing the required parameter "primaryPeriodStartWorkday" when calling getGamificationInsightsGroupsTrends';
}
// verify the required parameter 'primaryPeriodEndWorkday' is set
if (primaryPeriodEndWorkday === undefined || primaryPeriodEndWorkday === null) {
throw 'Missing the required parameter "primaryPeriodEndWorkday" when calling getGamificationInsightsGroupsTrends';
}
return this.apiClient.callApi(
'/api/v2/gamification/insights/groups/trends',
'GET',
{ },
{ 'filterType': filterType,'filterId': filterId,'granularity': granularity,'comparativePeriodStartWorkday': comparativePeriodStartWorkday,'comparativePeriodEndWorkday': comparativePeriodEndWorkday,'primaryPeriodStartWorkday': primaryPeriodStartWorkday,'primaryPeriodEndWorkday': primaryPeriodEndWorkday },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get insights overall trend
*
* @param {Object} filterType Filter type for the query request.
* @param {String} filterId ID for the filter type.
* @param {Object} granularity Granularity
* @param {String} comparativePeriodStartWorkday The start work day of comparative period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} comparativePeriodEndWorkday The end work day of comparative period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} primaryPeriodStartWorkday The start work day of primary period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} primaryPeriodEndWorkday The end work day of primary period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
*/
getGamificationInsightsGroupsTrendsAll(filterType, filterId, granularity, comparativePeriodStartWorkday, comparativePeriodEndWorkday, primaryPeriodStartWorkday, primaryPeriodEndWorkday) {
// verify the required parameter 'filterType' is set
if (filterType === undefined || filterType === null) {
throw 'Missing the required parameter "filterType" when calling getGamificationInsightsGroupsTrendsAll';
}
// verify the required parameter 'filterId' is set
if (filterId === undefined || filterId === null) {
throw 'Missing the required parameter "filterId" when calling getGamificationInsightsGroupsTrendsAll';
}
// verify the required parameter 'granularity' is set
if (granularity === undefined || granularity === null) {
throw 'Missing the required parameter "granularity" when calling getGamificationInsightsGroupsTrendsAll';
}
// verify the required parameter 'comparativePeriodStartWorkday' is set
if (comparativePeriodStartWorkday === undefined || comparativePeriodStartWorkday === null) {
throw 'Missing the required parameter "comparativePeriodStartWorkday" when calling getGamificationInsightsGroupsTrendsAll';
}
// verify the required parameter 'comparativePeriodEndWorkday' is set
if (comparativePeriodEndWorkday === undefined || comparativePeriodEndWorkday === null) {
throw 'Missing the required parameter "comparativePeriodEndWorkday" when calling getGamificationInsightsGroupsTrendsAll';
}
// verify the required parameter 'primaryPeriodStartWorkday' is set
if (primaryPeriodStartWorkday === undefined || primaryPeriodStartWorkday === null) {
throw 'Missing the required parameter "primaryPeriodStartWorkday" when calling getGamificationInsightsGroupsTrendsAll';
}
// verify the required parameter 'primaryPeriodEndWorkday' is set
if (primaryPeriodEndWorkday === undefined || primaryPeriodEndWorkday === null) {
throw 'Missing the required parameter "primaryPeriodEndWorkday" when calling getGamificationInsightsGroupsTrendsAll';
}
return this.apiClient.callApi(
'/api/v2/gamification/insights/groups/trends/all',
'GET',
{ },
{ 'filterType': filterType,'filterId': filterId,'granularity': granularity,'comparativePeriodStartWorkday': comparativePeriodStartWorkday,'comparativePeriodEndWorkday': comparativePeriodEndWorkday,'primaryPeriodStartWorkday': primaryPeriodStartWorkday,'primaryPeriodEndWorkday': primaryPeriodEndWorkday },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Query users in a profile during a period of time
*
* @param {Object} filterType Filter type for the query request.
* @param {String} filterId ID for the filter type.
* @param {Object} granularity Granularity
* @param {String} startWorkday The start work day. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
*/
getGamificationInsightsMembers(filterType, filterId, granularity, startWorkday) {
// verify the required parameter 'filterType' is set
if (filterType === undefined || filterType === null) {
throw 'Missing the required parameter "filterType" when calling getGamificationInsightsMembers';
}
// verify the required parameter 'filterId' is set
if (filterId === undefined || filterId === null) {
throw 'Missing the required parameter "filterId" when calling getGamificationInsightsMembers';
}
// verify the required parameter 'granularity' is set
if (granularity === undefined || granularity === null) {
throw 'Missing the required parameter "granularity" when calling getGamificationInsightsMembers';
}
// verify the required parameter 'startWorkday' is set
if (startWorkday === undefined || startWorkday === null) {
throw 'Missing the required parameter "startWorkday" when calling getGamificationInsightsMembers';
}
return this.apiClient.callApi(
'/api/v2/gamification/insights/members',
'GET',
{ },
{ 'filterType': filterType,'filterId': filterId,'granularity': granularity,'startWorkday': startWorkday },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get insights rankings
*
* @param {Object} filterType Filter type for the query request.
* @param {String} filterId ID for the filter type.
* @param {Object} granularity Granularity
* @param {String} comparativePeriodStartWorkday The start work day of comparative period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} primaryPeriodStartWorkday The start work day of primary period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {Object} sortKey Sort key
* @param {Object} opts Optional parameters
* @param {String} opts.sortMetricId Sort Metric Id
* @param {Number} opts.sectionSize The number of top and bottom users to return before ties
* @param {String} opts.userIds A list of up to 100 comma-separated user Ids
*/
getGamificationInsightsRankings(filterType, filterId, granularity, comparativePeriodStartWorkday, primaryPeriodStartWorkday, sortKey, opts) {
opts = opts || {};
// verify the required parameter 'filterType' is set
if (filterType === undefined || filterType === null) {
throw 'Missing the required parameter "filterType" when calling getGamificationInsightsRankings';
}
// verify the required parameter 'filterId' is set
if (filterId === undefined || filterId === null) {
throw 'Missing the required parameter "filterId" when calling getGamificationInsightsRankings';
}
// verify the required parameter 'granularity' is set
if (granularity === undefined || granularity === null) {
throw 'Missing the required parameter "granularity" when calling getGamificationInsightsRankings';
}
// verify the required parameter 'comparativePeriodStartWorkday' is set
if (comparativePeriodStartWorkday === undefined || comparativePeriodStartWorkday === null) {
throw 'Missing the required parameter "comparativePeriodStartWorkday" when calling getGamificationInsightsRankings';
}
// verify the required parameter 'primaryPeriodStartWorkday' is set
if (primaryPeriodStartWorkday === undefined || primaryPeriodStartWorkday === null) {
throw 'Missing the required parameter "primaryPeriodStartWorkday" when calling getGamificationInsightsRankings';
}
// verify the required parameter 'sortKey' is set
if (sortKey === undefined || sortKey === null) {
throw 'Missing the required parameter "sortKey" when calling getGamificationInsightsRankings';
}
return this.apiClient.callApi(
'/api/v2/gamification/insights/rankings',
'GET',
{ },
{ 'filterType': filterType,'filterId': filterId,'granularity': granularity,'comparativePeriodStartWorkday': comparativePeriodStartWorkday,'primaryPeriodStartWorkday': primaryPeriodStartWorkday,'sortKey': sortKey,'sortMetricId': opts['sortMetricId'],'sectionSize': opts['sectionSize'],'userIds': opts['userIds'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get insights user trend for the current user
*
* @param {Object} filterType Filter type for the query request.
* @param {String} filterId ID for the filter type.
* @param {Object} granularity Granularity
* @param {String} comparativePeriodStartWorkday The start work day of comparative period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} comparativePeriodEndWorkday The end work day of comparative period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} primaryPeriodStartWorkday The start work day of primary period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} primaryPeriodEndWorkday The end work day of primary period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
*/
getGamificationInsightsTrends(filterType, filterId, granularity, comparativePeriodStartWorkday, comparativePeriodEndWorkday, primaryPeriodStartWorkday, primaryPeriodEndWorkday) {
// verify the required parameter 'filterType' is set
if (filterType === undefined || filterType === null) {
throw 'Missing the required parameter "filterType" when calling getGamificationInsightsTrends';
}
// verify the required parameter 'filterId' is set
if (filterId === undefined || filterId === null) {
throw 'Missing the required parameter "filterId" when calling getGamificationInsightsTrends';
}
// verify the required parameter 'granularity' is set
if (granularity === undefined || granularity === null) {
throw 'Missing the required parameter "granularity" when calling getGamificationInsightsTrends';
}
// verify the required parameter 'comparativePeriodStartWorkday' is set
if (comparativePeriodStartWorkday === undefined || comparativePeriodStartWorkday === null) {
throw 'Missing the required parameter "comparativePeriodStartWorkday" when calling getGamificationInsightsTrends';
}
// verify the required parameter 'comparativePeriodEndWorkday' is set
if (comparativePeriodEndWorkday === undefined || comparativePeriodEndWorkday === null) {
throw 'Missing the required parameter "comparativePeriodEndWorkday" when calling getGamificationInsightsTrends';
}
// verify the required parameter 'primaryPeriodStartWorkday' is set
if (primaryPeriodStartWorkday === undefined || primaryPeriodStartWorkday === null) {
throw 'Missing the required parameter "primaryPeriodStartWorkday" when calling getGamificationInsightsTrends';
}
// verify the required parameter 'primaryPeriodEndWorkday' is set
if (primaryPeriodEndWorkday === undefined || primaryPeriodEndWorkday === null) {
throw 'Missing the required parameter "primaryPeriodEndWorkday" when calling getGamificationInsightsTrends';
}
return this.apiClient.callApi(
'/api/v2/gamification/insights/trends',
'GET',
{ },
{ 'filterType': filterType,'filterId': filterId,'granularity': granularity,'comparativePeriodStartWorkday': comparativePeriodStartWorkday,'comparativePeriodEndWorkday': comparativePeriodEndWorkday,'primaryPeriodStartWorkday': primaryPeriodStartWorkday,'primaryPeriodEndWorkday': primaryPeriodEndWorkday },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get insights details for the user
*
* @param {String} userId The ID of a user.
* @param {Object} filterType Filter type for the query request.
* @param {String} filterId ID for the filter type.
* @param {Object} granularity Granularity
* @param {String} comparativePeriodStartWorkday The start work day of comparative period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} primaryPeriodStartWorkday The start work day of primary period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
*/
getGamificationInsightsUserDetails(userId, filterType, filterId, granularity, comparativePeriodStartWorkday, primaryPeriodStartWorkday) {
// verify the required parameter 'userId' is set
if (userId === undefined || userId === null) {
throw 'Missing the required parameter "userId" when calling getGamificationInsightsUserDetails';
}
// verify the required parameter 'filterType' is set
if (filterType === undefined || filterType === null) {
throw 'Missing the required parameter "filterType" when calling getGamificationInsightsUserDetails';
}
// verify the required parameter 'filterId' is set
if (filterId === undefined || filterId === null) {
throw 'Missing the required parameter "filterId" when calling getGamificationInsightsUserDetails';
}
// verify the required parameter 'granularity' is set
if (granularity === undefined || granularity === null) {
throw 'Missing the required parameter "granularity" when calling getGamificationInsightsUserDetails';
}
// verify the required parameter 'comparativePeriodStartWorkday' is set
if (comparativePeriodStartWorkday === undefined || comparativePeriodStartWorkday === null) {
throw 'Missing the required parameter "comparativePeriodStartWorkday" when calling getGamificationInsightsUserDetails';
}
// verify the required parameter 'primaryPeriodStartWorkday' is set
if (primaryPeriodStartWorkday === undefined || primaryPeriodStartWorkday === null) {
throw 'Missing the required parameter "primaryPeriodStartWorkday" when calling getGamificationInsightsUserDetails';
}
return this.apiClient.callApi(
'/api/v2/gamification/insights/users/{userId}/details',
'GET',
{ 'userId': userId },
{ 'filterType': filterType,'filterId': filterId,'granularity': granularity,'comparativePeriodStartWorkday': comparativePeriodStartWorkday,'primaryPeriodStartWorkday': primaryPeriodStartWorkday },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get insights user trend for the user
*
* @param {String} userId The ID of a user.
* @param {Object} filterType Filter type for the query request.
* @param {String} filterId ID for the filter type.
* @param {Object} granularity Granularity
* @param {String} comparativePeriodStartWorkday The start work day of comparative period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} comparativePeriodEndWorkday The end work day of comparative period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} primaryPeriodStartWorkday The start work day of primary period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} primaryPeriodEndWorkday The end work day of primary period. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
*/
getGamificationInsightsUserTrends(userId, filterType, filterId, granularity, comparativePeriodStartWorkday, comparativePeriodEndWorkday, primaryPeriodStartWorkday, primaryPeriodEndWorkday) {
// verify the required parameter 'userId' is set
if (userId === undefined || userId === null) {
throw 'Missing the required parameter "userId" when calling getGamificationInsightsUserTrends';
}
// verify the required parameter 'filterType' is set
if (filterType === undefined || filterType === null) {
throw 'Missing the required parameter "filterType" when calling getGamificationInsightsUserTrends';
}
// verify the required parameter 'filterId' is set
if (filterId === undefined || filterId === null) {
throw 'Missing the required parameter "filterId" when calling getGamificationInsightsUserTrends';
}
// verify the required parameter 'granularity' is set
if (granularity === undefined || granularity === null) {
throw 'Missing the required parameter "granularity" when calling getGamificationInsightsUserTrends';
}
// verify the required parameter 'comparativePeriodStartWorkday' is set
if (comparativePeriodStartWorkday === undefined || comparativePeriodStartWorkday === null) {
throw 'Missing the required parameter "comparativePeriodStartWorkday" when calling getGamificationInsightsUserTrends';
}
// verify the required parameter 'comparativePeriodEndWorkday' is set
if (comparativePeriodEndWorkday === undefined || comparativePeriodEndWorkday === null) {
throw 'Missing the required parameter "comparativePeriodEndWorkday" when calling getGamificationInsightsUserTrends';
}
// verify the required parameter 'primaryPeriodStartWorkday' is set
if (primaryPeriodStartWorkday === undefined || primaryPeriodStartWorkday === null) {
throw 'Missing the required parameter "primaryPeriodStartWorkday" when calling getGamificationInsightsUserTrends';
}
// verify the required parameter 'primaryPeriodEndWorkday' is set
if (primaryPeriodEndWorkday === undefined || primaryPeriodEndWorkday === null) {
throw 'Missing the required parameter "primaryPeriodEndWorkday" when calling getGamificationInsightsUserTrends';
}
return this.apiClient.callApi(
'/api/v2/gamification/insights/users/{userId}/trends',
'GET',
{ 'userId': userId },
{ 'filterType': filterType,'filterId': filterId,'granularity': granularity,'comparativePeriodStartWorkday': comparativePeriodStartWorkday,'comparativePeriodEndWorkday': comparativePeriodEndWorkday,'primaryPeriodStartWorkday': primaryPeriodStartWorkday,'primaryPeriodEndWorkday': primaryPeriodEndWorkday },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Leaderboard of the requesting user's division or performance profile
*
* @param {String} startWorkday Start workday to retrieve for the leaderboard. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} endWorkday End workday to retrieve for the leaderboard. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {Object} opts Optional parameters
* @param {String} opts.metricId Metric Id for which the leaderboard is to be generated. The total points is used if nothing is given.
*/
getGamificationLeaderboard(startWorkday, endWorkday, opts) {
opts = opts || {};
// verify the required parameter 'startWorkday' is set
if (startWorkday === undefined || startWorkday === null) {
throw 'Missing the required parameter "startWorkday" when calling getGamificationLeaderboard';
}
// verify the required parameter 'endWorkday' is set
if (endWorkday === undefined || endWorkday === null) {
throw 'Missing the required parameter "endWorkday" when calling getGamificationLeaderboard';
}
return this.apiClient.callApi(
'/api/v2/gamification/leaderboard',
'GET',
{ },
{ 'startWorkday': startWorkday,'endWorkday': endWorkday,'metricId': opts['metricId'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Leaderboard by filter type
*
* @param {Object} filterType Filter type for the query request.
* @param {String} filterId ID for the filter type. For example, division or performance profile Id
* @param {String} startWorkday Start workday to retrieve for the leaderboard. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} endWorkday End workday to retrieve for the leaderboard. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {Object} opts Optional parameters
* @param {String} opts.metricId Metric Id for which the leaderboard is to be generated. The total points is used if nothing is given.
*/
getGamificationLeaderboardAll(filterType, filterId, startWorkday, endWorkday, opts) {
opts = opts || {};
// verify the required parameter 'filterType' is set
if (filterType === undefined || filterType === null) {
throw 'Missing the required parameter "filterType" when calling getGamificationLeaderboardAll';
}
// verify the required parameter 'filterId' is set
if (filterId === undefined || filterId === null) {
throw 'Missing the required parameter "filterId" when calling getGamificationLeaderboardAll';
}
// verify the required parameter 'startWorkday' is set
if (startWorkday === undefined || startWorkday === null) {
throw 'Missing the required parameter "startWorkday" when calling getGamificationLeaderboardAll';
}
// verify the required parameter 'endWorkday' is set
if (endWorkday === undefined || endWorkday === null) {
throw 'Missing the required parameter "endWorkday" when calling getGamificationLeaderboardAll';
}
return this.apiClient.callApi(
'/api/v2/gamification/leaderboard/all',
'GET',
{ },
{ 'filterType': filterType,'filterId': filterId,'startWorkday': startWorkday,'endWorkday': endWorkday,'metricId': opts['metricId'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Best Points by division or performance profile
*
* @param {Object} filterType Filter type for the query request.
* @param {String} filterId ID for the filter type. For example, division or performance profile Id
*/
getGamificationLeaderboardAllBestpoints(filterType, filterId) {
// verify the required parameter 'filterType' is set
if (filterType === undefined || filterType === null) {
throw 'Missing the required parameter "filterType" when calling getGamificationLeaderboardAllBestpoints';
}
// verify the required parameter 'filterId' is set
if (filterId === undefined || filterId === null) {
throw 'Missing the required parameter "filterId" when calling getGamificationLeaderboardAllBestpoints';
}
return this.apiClient.callApi(
'/api/v2/gamification/leaderboard/all/bestpoints',
'GET',
{ },
{ 'filterType': filterType,'filterId': filterId },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Best Points of the requesting user's current performance profile or division
*
*/
getGamificationLeaderboardBestpoints() {
return this.apiClient.callApi(
'/api/v2/gamification/leaderboard/bestpoints',
'GET',
{ },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Metric definition by id
*
* @param {String} metricDefinitionId metric definition id
*/
getGamificationMetricdefinition(metricDefinitionId) {
// verify the required parameter 'metricDefinitionId' is set
if (metricDefinitionId === undefined || metricDefinitionId === null) {
throw 'Missing the required parameter "metricDefinitionId" when calling getGamificationMetricdefinition';
}
return this.apiClient.callApi(
'/api/v2/gamification/metricdefinitions/{metricDefinitionId}',
'GET',
{ 'metricDefinitionId': metricDefinitionId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* All metric definitions
* Retrieves the metric definitions and their corresponding default objectives used to create a gamified metric
*/
getGamificationMetricdefinitions() {
return this.apiClient.callApi(
'/api/v2/gamification/metricdefinitions',
'GET',
{ },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Performance profile by id
*
* @param {String} profileId performanceProfileId
*/
getGamificationProfile(profileId) {
// verify the required parameter 'profileId' is set
if (profileId === undefined || profileId === null) {
throw 'Missing the required parameter "profileId" when calling getGamificationProfile';
}
return this.apiClient.callApi(
'/api/v2/gamification/profiles/{profileId}',
'GET',
{ 'profileId': profileId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Members of a given performance profile
*
* @param {String} profileId Profile Id
*/
getGamificationProfileMembers(profileId) {
// verify the required parameter 'profileId' is set
if (profileId === undefined || profileId === null) {
throw 'Missing the required parameter "profileId" when calling getGamificationProfileMembers';
}
return this.apiClient.callApi(
'/api/v2/gamification/profiles/{profileId}/members',
'GET',
{ 'profileId': profileId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Performance profile gamified metric by id
*
* @param {String} profileId Performance Profile Id
* @param {String} metricId Metric Id
* @param {Object} opts Optional parameters
* @param {String} opts.workday The objective query workday. If not specified, then it retrieves the current objective. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
*/
getGamificationProfileMetric(profileId, metricId, opts) {
opts = opts || {};
// verify the required parameter 'profileId' is set
if (profileId === undefined || profileId === null) {
throw 'Missing the required parameter "profileId" when calling getGamificationProfileMetric';
}
// verify the required parameter 'metricId' is set
if (metricId === undefined || metricId === null) {
throw 'Missing the required parameter "metricId" when calling getGamificationProfileMetric';
}
return this.apiClient.callApi(
'/api/v2/gamification/profiles/{profileId}/metrics/{metricId}',
'GET',
{ 'profileId': profileId,'metricId': metricId },
{ 'workday': opts['workday'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* All gamified metrics for a given performance profile
*
* @param {String} profileId Performance Profile Id
* @param {Object} opts Optional parameters
* @param {Array.<String>} opts.expand Which fields, if any, to expand.
* @param {String} opts.workday The objective query workday. If not specified, then it retrieves the current objective. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} opts.metricIds List of metric ids to filter the response (Optional, comma-separated).
*/
getGamificationProfileMetrics(profileId, opts) {
opts = opts || {};
// verify the required parameter 'profileId' is set
if (profileId === undefined || profileId === null) {
throw 'Missing the required parameter "profileId" when calling getGamificationProfileMetrics';
}
return this.apiClient.callApi(
'/api/v2/gamification/profiles/{profileId}/metrics',
'GET',
{ 'profileId': profileId },
{ 'expand': this.apiClient.buildCollectionParam(opts['expand'], 'multi'),'workday': opts['workday'],'metricIds': opts['metricIds'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* All metrics for a given performance profile with objective details such as order and maxPoints
*
* @param {String} profileId Performance Profile Id
* @param {Object} opts Optional parameters
* @param {String} opts.workday The objective query workday. If not specified, then it retrieves the current objective. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
*/
getGamificationProfileMetricsObjectivedetails(profileId, opts) {
opts = opts || {};
// verify the required parameter 'profileId' is set
if (profileId === undefined || profileId === null) {
throw 'Missing the required parameter "profileId" when calling getGamificationProfileMetricsObjectivedetails';
}
return this.apiClient.callApi(
'/api/v2/gamification/profiles/{profileId}/metrics/objectivedetails',
'GET',
{ 'profileId': profileId },
{ 'workday': opts['workday'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* All performance profiles
*
*/
getGamificationProfiles() {
return this.apiClient.callApi(
'/api/v2/gamification/profiles',
'GET',
{ },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Performance profile of a user
*
* @param {String} userId
* @param {Object} opts Optional parameters
* @param {String} opts.workday Target querying workday. If not provided, then queries the current performance profile. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
*/
getGamificationProfilesUser(userId, opts) {
opts = opts || {};
// verify the required parameter 'userId' is set
if (userId === undefined || userId === null) {
throw 'Missing the required parameter "userId" when calling getGamificationProfilesUser';
}
return this.apiClient.callApi(
'/api/v2/gamification/profiles/users/{userId}',
'GET',
{ 'userId': userId },
{ 'workday': opts['workday'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Performance profile of the requesting user
*
* @param {Object} opts Optional parameters
* @param {String} opts.workday Target querying workday. If not provided, then queries the current performance profile. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
*/
getGamificationProfilesUsersMe(opts) {
opts = opts || {};
return this.apiClient.callApi(
'/api/v2/gamification/profiles/users/me',
'GET',
{ },
{ 'workday': opts['workday'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Workday performance metrics of the requesting user
*
* @param {String} workday Target querying workday. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {Object} opts Optional parameters
* @param {Array.<String>} opts.expand Which fields, if any, to expand.
*/
getGamificationScorecards(workday, opts) {
opts = opts || {};
// verify the required parameter 'workday' is set
if (workday === undefined || workday === null) {
throw 'Missing the required parameter "workday" when calling getGamificationScorecards';
}
return this.apiClient.callApi(
'/api/v2/gamification/scorecards',
'GET',
{ },
{ 'workday': workday,'expand': this.apiClient.buildCollectionParam(opts['expand'], 'multi') },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Attendance status metrics of the requesting user
*
* @param {String} startWorkday Start workday of querying workdays range. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
* @param {String} endWo