purecloud-platform-client-v2
Version:
A JavaScript library to interface with the PureCloud Platform API
189 lines (167 loc) • 4.8 kB
JavaScript
import ApiClient from '../ApiClient.js';
class FlowsApi {
/**
* Flows service.
* @module purecloud-platform-client-v2/api/FlowsApi
* @version 223.0.0
*/
/**
* Constructs a new FlowsApi.
* @alias module:purecloud-platform-client-v2/api/FlowsApi
* @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;
}
/**
* Get status for async query for Flow aggregates
*
* @param {String} jobId jobId
* getAnalyticsFlowsAggregatesJob is a preview method and is subject to both breaking and non-breaking changes at any time without notice
*/
getAnalyticsFlowsAggregatesJob(jobId) {
// verify the required parameter 'jobId' is set
if (jobId === undefined || jobId === null) {
throw 'Missing the required parameter "jobId" when calling getAnalyticsFlowsAggregatesJob';
}
return this.apiClient.callApi(
'/api/v2/analytics/flows/aggregates/jobs/{jobId}',
'GET',
{ 'jobId': jobId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Fetch a page of results for an async aggregates query
*
* @param {String} jobId jobId
* @param {Object} opts Optional parameters
* @param {String} opts.cursor Cursor token to retrieve next page
* getAnalyticsFlowsAggregatesJobResults is a preview method and is subject to both breaking and non-breaking changes at any time without notice
*/
getAnalyticsFlowsAggregatesJobResults(jobId, opts) {
opts = opts || {};
// verify the required parameter 'jobId' is set
if (jobId === undefined || jobId === null) {
throw 'Missing the required parameter "jobId" when calling getAnalyticsFlowsAggregatesJobResults';
}
return this.apiClient.callApi(
'/api/v2/analytics/flows/aggregates/jobs/{jobId}/results',
'GET',
{ 'jobId': jobId },
{ 'cursor': opts['cursor'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Query for flow activity observations
*
* @param {Object} body query
* @param {Object} opts Optional parameters
* @param {Number} opts.pageSize The desired page size
* @param {Number} opts.pageNumber The desired page number
*/
postAnalyticsFlowsActivityQuery(body, opts) {
opts = opts || {};
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw 'Missing the required parameter "body" when calling postAnalyticsFlowsActivityQuery';
}
return this.apiClient.callApi(
'/api/v2/analytics/flows/activity/query',
'POST',
{ },
{ 'pageSize': opts['pageSize'],'pageNumber': opts['pageNumber'] },
{ },
{ },
body,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Query for flow aggregates asynchronously
*
* @param {Object} body query
* postAnalyticsFlowsAggregatesJobs is a preview method and is subject to both breaking and non-breaking changes at any time without notice
*/
postAnalyticsFlowsAggregatesJobs(body) {
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw 'Missing the required parameter "body" when calling postAnalyticsFlowsAggregatesJobs';
}
return this.apiClient.callApi(
'/api/v2/analytics/flows/aggregates/jobs',
'POST',
{ },
{ },
{ },
{ },
body,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Query for flow aggregates
*
* @param {Object} body query
*/
postAnalyticsFlowsAggregatesQuery(body) {
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw 'Missing the required parameter "body" when calling postAnalyticsFlowsAggregatesQuery';
}
return this.apiClient.callApi(
'/api/v2/analytics/flows/aggregates/query',
'POST',
{ },
{ },
{ },
{ },
body,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Query for flow observations
*
* @param {Object} body query
*/
postAnalyticsFlowsObservationsQuery(body) {
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw 'Missing the required parameter "body" when calling postAnalyticsFlowsObservationsQuery';
}
return this.apiClient.callApi(
'/api/v2/analytics/flows/observations/query',
'POST',
{ },
{ },
{ },
{ },
body,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
}
export default FlowsApi;