purecloud-platform-client-v2 139.0.0 → 141.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +2 -2
  2. package/dist/node/purecloud-platform-client-v2.js +420 -116
  3. package/dist/web-amd/purecloud-platform-client-v2.js +420 -117
  4. package/dist/web-amd/purecloud-platform-client-v2.min.js +1 -1
  5. package/dist/web-cjs/bundle.js +420 -116
  6. package/dist/web-cjs/purecloud-platform-client-v2.js +2514 -154
  7. package/dist/web-cjs/purecloud-platform-client-v2.min.js +1 -1
  8. package/index.d.ts +499 -207
  9. package/package.json +2 -1
  10. package/src/purecloud-platform-client-v2/ApiClient.js +18 -16
  11. package/src/purecloud-platform-client-v2/api/AlertingApi.js +1 -1
  12. package/src/purecloud-platform-client-v2/api/AnalyticsApi.js +1 -1
  13. package/src/purecloud-platform-client-v2/api/ArchitectApi.js +1 -1
  14. package/src/purecloud-platform-client-v2/api/AuditApi.js +1 -1
  15. package/src/purecloud-platform-client-v2/api/AuthorizationApi.js +15 -15
  16. package/src/purecloud-platform-client-v2/api/BillingApi.js +1 -1
  17. package/src/purecloud-platform-client-v2/api/ChatApi.js +1 -1
  18. package/src/purecloud-platform-client-v2/api/CoachingApi.js +1 -1
  19. package/src/purecloud-platform-client-v2/api/ContentManagementApi.js +1 -1
  20. package/src/purecloud-platform-client-v2/api/ConversationsApi.js +1 -1
  21. package/src/purecloud-platform-client-v2/api/DataExtensionsApi.js +1 -1
  22. package/src/purecloud-platform-client-v2/api/ExternalContactsApi.js +1 -1
  23. package/src/purecloud-platform-client-v2/api/FaxApi.js +1 -1
  24. package/src/purecloud-platform-client-v2/api/FlowsApi.js +1 -1
  25. package/src/purecloud-platform-client-v2/api/GamificationApi.js +156 -5
  26. package/src/purecloud-platform-client-v2/api/GeneralDataProtectionRegulationApi.js +1 -1
  27. package/src/purecloud-platform-client-v2/api/GeolocationApi.js +1 -1
  28. package/src/purecloud-platform-client-v2/api/GreetingsApi.js +1 -1
  29. package/src/purecloud-platform-client-v2/api/GroupsApi.js +1 -1
  30. package/src/purecloud-platform-client-v2/api/IdentityProviderApi.js +1 -1
  31. package/src/purecloud-platform-client-v2/api/IntegrationsApi.js +1 -1
  32. package/src/purecloud-platform-client-v2/api/JourneyApi.js +1 -1
  33. package/src/purecloud-platform-client-v2/api/KnowledgeApi.js +1 -1
  34. package/src/purecloud-platform-client-v2/api/LanguageUnderstandingApi.js +1 -1
  35. package/src/purecloud-platform-client-v2/api/LanguagesApi.js +1 -1
  36. package/src/purecloud-platform-client-v2/api/LearningApi.js +145 -1
  37. package/src/purecloud-platform-client-v2/api/LicenseApi.js +1 -1
  38. package/src/purecloud-platform-client-v2/api/LocationsApi.js +1 -1
  39. package/src/purecloud-platform-client-v2/api/MessagingApi.js +1 -1
  40. package/src/purecloud-platform-client-v2/api/MobileDevicesApi.js +1 -1
  41. package/src/purecloud-platform-client-v2/api/NotificationsApi.js +1 -1
  42. package/src/purecloud-platform-client-v2/api/OAuthApi.js +1 -1
  43. package/src/purecloud-platform-client-v2/api/ObjectsApi.js +1 -1
  44. package/src/purecloud-platform-client-v2/api/OrganizationApi.js +1 -1
  45. package/src/purecloud-platform-client-v2/api/OrganizationAuthorizationApi.js +1 -1
  46. package/src/purecloud-platform-client-v2/api/OutboundApi.js +1 -1
  47. package/src/purecloud-platform-client-v2/api/PresenceApi.js +1 -1
  48. package/src/purecloud-platform-client-v2/api/QualityApi.js +2 -2
  49. package/src/purecloud-platform-client-v2/api/RecordingApi.js +1 -1
  50. package/src/purecloud-platform-client-v2/api/ResponseManagementApi.js +1 -1
  51. package/src/purecloud-platform-client-v2/api/RoutingApi.js +11 -5
  52. package/src/purecloud-platform-client-v2/api/SCIMApi.js +1 -1
  53. package/src/purecloud-platform-client-v2/api/ScriptsApi.js +1 -1
  54. package/src/purecloud-platform-client-v2/api/SearchApi.js +1 -1
  55. package/src/purecloud-platform-client-v2/api/SpeechTextAnalyticsApi.js +1 -1
  56. package/src/purecloud-platform-client-v2/api/StationsApi.js +1 -1
  57. package/src/purecloud-platform-client-v2/api/SuggestApi.js +1 -1
  58. package/src/purecloud-platform-client-v2/api/TelephonyApi.js +1 -1
  59. package/src/purecloud-platform-client-v2/api/TelephonyProvidersEdgeApi.js +1 -1
  60. package/src/purecloud-platform-client-v2/api/TextbotsApi.js +1 -1
  61. package/src/purecloud-platform-client-v2/api/TokensApi.js +1 -1
  62. package/src/purecloud-platform-client-v2/api/UploadsApi.js +1 -1
  63. package/src/purecloud-platform-client-v2/api/UsageApi.js +1 -1
  64. package/src/purecloud-platform-client-v2/api/UserRecordingsApi.js +1 -1
  65. package/src/purecloud-platform-client-v2/api/UsersApi.js +15 -15
  66. package/src/purecloud-platform-client-v2/api/UtilitiesApi.js +1 -1
  67. package/src/purecloud-platform-client-v2/api/VoicemailApi.js +1 -1
  68. package/src/purecloud-platform-client-v2/api/WebChatApi.js +1 -1
  69. package/src/purecloud-platform-client-v2/api/WebDeploymentsApi.js +1 -1
  70. package/src/purecloud-platform-client-v2/api/WebMessagingApi.js +1 -1
  71. package/src/purecloud-platform-client-v2/api/WidgetsApi.js +1 -1
  72. package/src/purecloud-platform-client-v2/api/WorkforceManagementApi.js +1 -1
  73. package/src/purecloud-platform-client-v2/index.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "purecloud-platform-client-v2",
3
- "version": "139.0.0",
3
+ "version": "141.0.0",
4
4
  "description": "A JavaScript library to interface with the PureCloud Platform API",
5
5
  "license": "MIT",
6
6
  "main": "dist/node/purecloud-platform-client-v2.js",
@@ -32,6 +32,7 @@
32
32
  "dependencies": {
33
33
  "axios": "^0.27.2",
34
34
  "configparser": "^0.3.9",
35
+ "qs": "^6.10.3",
35
36
  "winston": "^3.6.0"
36
37
  },
37
38
  "devDependencies": {
@@ -1,9 +1,10 @@
1
1
  import { default as axios } from 'axios';
2
2
  import Configuration from './configuration.js';
3
+ import { default as qs } from 'qs';
3
4
 
4
5
  /**
5
6
  * @module purecloud-platform-client-v2/ApiClient
6
- * @version 139.0.0
7
+ * @version 141.0.0
7
8
  */
8
9
  class ApiClient {
9
10
  /**
@@ -38,7 +39,7 @@ class ApiClient {
38
39
 
39
40
  /**
40
41
  * Enumeration of collection format separator strategies.
41
- * @enum {String}
42
+ * @enum {String}
42
43
  * @readonly
43
44
  */
44
45
  this.CollectionFormatEnum = {
@@ -185,7 +186,7 @@ class ApiClient {
185
186
  // Load current auth data
186
187
  const tempState = this.authData.state;
187
188
  this.authData = localStorage.getItem(`${this.settingsPrefix}_auth_data`);
188
- if (!this.authData)
189
+ if (!this.authData)
189
190
  this.authData = {};
190
191
  else
191
192
  this.authData = JSON.parse(this.authData);
@@ -205,7 +206,7 @@ class ApiClient {
205
206
  * @description Initiates the implicit grant login flow. Will attempt to load the token from local storage, if enabled.
206
207
  * @param {string} clientId - The client ID of an OAuth Implicit Grant client
207
208
  * @param {string} redirectUri - The redirect URI of the OAuth Implicit Grant client
208
- * @param {object} opts - (optional) Additional options
209
+ * @param {object} opts - (optional) Additional options
209
210
  * @param {string} opts.state - (optional) An arbitrary string to be passed back with the login response. Used for client apps to associate login responses with a request.
210
211
  * @param {string} opts.org - (optional) The organization name that would normally used when specifying an organization name when logging in. This is only used when a provider is also specified.
211
212
  * @param {string} opts.provider - (optional) Authentication provider to log in with e.g. okta, adfs, salesforce, onelogin. This is only used when an org is also specified.
@@ -351,9 +352,9 @@ class ApiClient {
351
352
  }
352
353
  var encodedData = Buffer.from(clientId + ':' + clientSecret).toString('base64');
353
354
  var request = this._formAuthRequest(encodedData,
354
- { grant_type: 'urn:ietf:params:oauth:grant-type:saml2-bearer' },
355
- { orgName: orgName },
356
- { assertion: assertion });
355
+ { grant_type: 'urn:ietf:params:oauth:grant-type:saml2-bearer',
356
+ orgName: orgName,
357
+ assertion: assertion });
357
358
  request.proxy = this.proxy;
358
359
  var bodyParam = {
359
360
  grant_type: 'urn:ietf:params:oauth:grant-type:saml2-bearer',
@@ -432,9 +433,9 @@ class ApiClient {
432
433
  }
433
434
  var encodedData = Buffer.from(clientId + ':' + clientSecret).toString('base64');
434
435
  var request = this._formAuthRequest(encodedData,
435
- { grant_type: 'authorization_code' },
436
- { code: authCode },
437
- { redirect_uri: redirectUri });
436
+ { grant_type: 'authorization_code',
437
+ code: authCode,
438
+ redirect_uri: redirectUri });
438
439
  request.proxy = this.proxy;
439
440
  var bodyParam = {
440
441
  grant_type: 'authorization_code',
@@ -460,7 +461,7 @@ class ApiClient {
460
461
  return;
461
462
  }
462
463
  var encodedData = Buffer.from(clientId + ':' + clientSecret).toString('base64');
463
- var request = this._formAuthRequest(encodedData, { grant_type: 'refresh_token' }, { refresh_token: refreshToken });
464
+ var request = this._formAuthRequest(encodedData, { grant_type: 'refresh_token' , refresh_token: refreshToken });
464
465
  request.proxy = this.proxy;
465
466
  var bodyParam = {
466
467
  grant_type: 'refresh_token',
@@ -537,8 +538,9 @@ class ApiClient {
537
538
  /**
538
539
  * @description Utility function to create the request for auth requests
539
540
  * @param {string} encodedData - Base64 encoded client and clientSecret pair
541
+ * @param {object} data - data to url form encode
540
542
  */
541
- _formAuthRequest(encodedData) {
543
+ _formAuthRequest(encodedData, data) {
542
544
  var request = axios({
543
545
  method: `POST`,
544
546
  url: `https://login.${this.config.environment}/oauth/token`,
@@ -546,7 +548,7 @@ class ApiClient {
546
548
  'Authorization': 'Basic ' + encodedData,
547
549
  'Content-Type': 'application/x-www-form-urlencoded'
548
550
  },
549
- data: arguments
551
+ data: qs.stringify(data)
550
552
  });
551
553
 
552
554
  return request;
@@ -610,7 +612,7 @@ class ApiClient {
610
612
  }
611
613
 
612
614
  // Test token
613
- this.callApi('/api/v2/tokens/me', 'GET',
615
+ this.callApi('/api/v2/tokens/me', 'GET',
614
616
  null, null, null, null, null, ['PureCloud OAuth'], ['application/json'], ['application/json'])
615
617
  .then(() => {
616
618
  resolve();
@@ -636,7 +638,7 @@ class ApiClient {
636
638
  const match = hashRegex.exec(h);
637
639
  if (match) hash[match[1]] = decodeURIComponent(decodeURIComponent(match[2].replace(/\+/g, '%20')));
638
640
  });
639
-
641
+
640
642
  // Check for error
641
643
  if (hash.error) {
642
644
  return hash;
@@ -834,7 +836,7 @@ class ApiClient {
834
836
  /**
835
837
  * Checks whether the given parameter value represents file-like content.
836
838
  * @param param The parameter to check.
837
- * @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
839
+ * @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
838
840
  */
839
841
  isFileParam(param) {
840
842
  // fs.ReadStream in Node.js (but not in runtime like browserify)
@@ -5,7 +5,7 @@ class AlertingApi {
5
5
  /**
6
6
  * Alerting service.
7
7
  * @module purecloud-platform-client-v2/api/AlertingApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class AnalyticsApi {
5
5
  /**
6
6
  * Analytics service.
7
7
  * @module purecloud-platform-client-v2/api/AnalyticsApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class ArchitectApi {
5
5
  /**
6
6
  * Architect service.
7
7
  * @module purecloud-platform-client-v2/api/ArchitectApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class AuditApi {
5
5
  /**
6
6
  * Audit service.
7
7
  * @module purecloud-platform-client-v2/api/AuditApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class AuthorizationApi {
5
5
  /**
6
6
  * Authorization service.
7
7
  * @module purecloud-platform-client-v2/api/AuthorizationApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -610,18 +610,18 @@ class AuthorizationApi {
610
610
  /**
611
611
  * Returns a listing of roles and permissions for a user.
612
612
  *
613
- * @param {String} userId User ID
613
+ * @param {String} subjectId User ID
614
614
  */
615
- getUserRoles(userId) {
616
- // verify the required parameter 'userId' is set
617
- if (userId === undefined || userId === null) {
618
- throw 'Missing the required parameter "userId" when calling getUserRoles';
615
+ getUserRoles(subjectId) {
616
+ // verify the required parameter 'subjectId' is set
617
+ if (subjectId === undefined || subjectId === null) {
618
+ throw 'Missing the required parameter "subjectId" when calling getUserRoles';
619
619
  }
620
620
 
621
621
  return this.apiClient.callApi(
622
- '/api/v2/users/{userId}/roles',
622
+ '/api/v2/users/{subjectId}/roles',
623
623
  'GET',
624
- { 'userId': userId },
624
+ { 'subjectId': subjectId },
625
625
  { },
626
626
  { },
627
627
  { },
@@ -1155,13 +1155,13 @@ class AuthorizationApi {
1155
1155
  /**
1156
1156
  * Sets the user's roles
1157
1157
  *
1158
- * @param {String} userId User ID
1158
+ * @param {String} subjectId User ID
1159
1159
  * @param {Array.<String>} body List of roles
1160
1160
  */
1161
- putUserRoles(userId, body) {
1162
- // verify the required parameter 'userId' is set
1163
- if (userId === undefined || userId === null) {
1164
- throw 'Missing the required parameter "userId" when calling putUserRoles';
1161
+ putUserRoles(subjectId, body) {
1162
+ // verify the required parameter 'subjectId' is set
1163
+ if (subjectId === undefined || subjectId === null) {
1164
+ throw 'Missing the required parameter "subjectId" when calling putUserRoles';
1165
1165
  }
1166
1166
  // verify the required parameter 'body' is set
1167
1167
  if (body === undefined || body === null) {
@@ -1169,9 +1169,9 @@ class AuthorizationApi {
1169
1169
  }
1170
1170
 
1171
1171
  return this.apiClient.callApi(
1172
- '/api/v2/users/{userId}/roles',
1172
+ '/api/v2/users/{subjectId}/roles',
1173
1173
  'PUT',
1174
- { 'userId': userId },
1174
+ { 'subjectId': subjectId },
1175
1175
  { },
1176
1176
  { },
1177
1177
  { },
@@ -5,7 +5,7 @@ class BillingApi {
5
5
  /**
6
6
  * Billing service.
7
7
  * @module purecloud-platform-client-v2/api/BillingApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class ChatApi {
5
5
  /**
6
6
  * Chat service.
7
7
  * @module purecloud-platform-client-v2/api/ChatApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class CoachingApi {
5
5
  /**
6
6
  * Coaching service.
7
7
  * @module purecloud-platform-client-v2/api/CoachingApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class ContentManagementApi {
5
5
  /**
6
6
  * ContentManagement service.
7
7
  * @module purecloud-platform-client-v2/api/ContentManagementApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class ConversationsApi {
5
5
  /**
6
6
  * Conversations service.
7
7
  * @module purecloud-platform-client-v2/api/ConversationsApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class DataExtensionsApi {
5
5
  /**
6
6
  * DataExtensions service.
7
7
  * @module purecloud-platform-client-v2/api/DataExtensionsApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class ExternalContactsApi {
5
5
  /**
6
6
  * ExternalContacts service.
7
7
  * @module purecloud-platform-client-v2/api/ExternalContactsApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class FaxApi {
5
5
  /**
6
6
  * Fax service.
7
7
  * @module purecloud-platform-client-v2/api/FaxApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class FlowsApi {
5
5
  /**
6
6
  * Flows service.
7
7
  * @module purecloud-platform-client-v2/api/FlowsApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class GamificationApi {
5
5
  /**
6
6
  * Gamification service.
7
7
  * @module purecloud-platform-client-v2/api/GamificationApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -150,7 +150,7 @@ class GamificationApi {
150
150
 
151
151
  /**
152
152
  * Gamified metric by id
153
- *
153
+ * This API is deprecated. Use /api/v2/gamification/profiles/{profileId}/metrics/{metricId} instead.
154
154
  * @param {String} metricId metric Id
155
155
  * @param {Object} opts Optional parameters
156
156
  * @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
@@ -225,7 +225,7 @@ class GamificationApi {
225
225
 
226
226
  /**
227
227
  * All gamified metrics for a given profile
228
- *
228
+ * This API is deprecated. Use /api/v2/gamification/profiles/{profileId}/metrics instead.
229
229
  * @param {Object} opts Optional parameters
230
230
  * @param {String} opts.performanceProfileId The profile id of the metrics you are trying to retrieve. The DEFAULT profile is used if nothing is given.
231
231
  * @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
@@ -628,6 +628,157 @@ class GamificationApi {
628
628
  );
629
629
  }
630
630
 
631
+ /**
632
+ * Average performance values trends by metric of a user
633
+ *
634
+ * @param {String} profileId performanceProfileId
635
+ * @param {String} metricId metricId
636
+ * @param {String} userId
637
+ * @param {String} startWorkday Start workday of querying workdays range. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
638
+ * @param {String} endWorkday End workday of querying workdays range. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
639
+ * @param {Object} opts Optional parameters
640
+ * @param {String} opts.referenceWorkday Reference workday for the trend. Used to determine the associated metric definition. If not set, then the value of endWorkday is used. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
641
+ * @param {String} opts.timeZone Timezone for the workday. Defaults to UTC (default to UTC)
642
+ */
643
+ getGamificationScorecardsProfileMetricUserValuesTrends(profileId, metricId, userId, startWorkday, endWorkday, opts) {
644
+ opts = opts || {};
645
+
646
+ // verify the required parameter 'profileId' is set
647
+ if (profileId === undefined || profileId === null) {
648
+ throw 'Missing the required parameter "profileId" when calling getGamificationScorecardsProfileMetricUserValuesTrends';
649
+ }
650
+ // verify the required parameter 'metricId' is set
651
+ if (metricId === undefined || metricId === null) {
652
+ throw 'Missing the required parameter "metricId" when calling getGamificationScorecardsProfileMetricUserValuesTrends';
653
+ }
654
+ // verify the required parameter 'userId' is set
655
+ if (userId === undefined || userId === null) {
656
+ throw 'Missing the required parameter "userId" when calling getGamificationScorecardsProfileMetricUserValuesTrends';
657
+ }
658
+ // verify the required parameter 'startWorkday' is set
659
+ if (startWorkday === undefined || startWorkday === null) {
660
+ throw 'Missing the required parameter "startWorkday" when calling getGamificationScorecardsProfileMetricUserValuesTrends';
661
+ }
662
+ // verify the required parameter 'endWorkday' is set
663
+ if (endWorkday === undefined || endWorkday === null) {
664
+ throw 'Missing the required parameter "endWorkday" when calling getGamificationScorecardsProfileMetricUserValuesTrends';
665
+ }
666
+
667
+ return this.apiClient.callApi(
668
+ '/api/v2/gamification/scorecards/profiles/{profileId}/metrics/{metricId}/users/{userId}/values/trends',
669
+ 'GET',
670
+ { 'profileId': profileId,'metricId': metricId,'userId': userId },
671
+ { 'startWorkday': startWorkday,'endWorkday': endWorkday,'referenceWorkday': opts['referenceWorkday'],'timeZone': opts['timeZone'] },
672
+ { },
673
+ { },
674
+ null,
675
+ ['PureCloud OAuth'],
676
+ ['application/json'],
677
+ ['application/json']
678
+ );
679
+ }
680
+
681
+ /**
682
+ * Average performance values trends by metric of a division or a performance profile
683
+ *
684
+ * @param {String} profileId performanceProfileId
685
+ * @param {String} metricId metricId
686
+ * @param {Object} filterType Filter type for the query request.
687
+ * @param {String} filterId ID for the filter type. For example, division Id
688
+ * @param {String} startWorkday Start workday of querying workdays range. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
689
+ * @param {String} endWorkday End workday of querying workdays range. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
690
+ * @param {Object} opts Optional parameters
691
+ * @param {String} opts.referenceWorkday Reference workday for the trend. Used to determine the associated metric definition. If not set, then the value of endWorkday is used. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
692
+ * @param {String} opts.timeZone Timezone for the workday. Defaults to UTC (default to UTC)
693
+ */
694
+ getGamificationScorecardsProfileMetricUsersValuesTrends(profileId, metricId, filterType, filterId, startWorkday, endWorkday, opts) {
695
+ opts = opts || {};
696
+
697
+ // verify the required parameter 'profileId' is set
698
+ if (profileId === undefined || profileId === null) {
699
+ throw 'Missing the required parameter "profileId" when calling getGamificationScorecardsProfileMetricUsersValuesTrends';
700
+ }
701
+ // verify the required parameter 'metricId' is set
702
+ if (metricId === undefined || metricId === null) {
703
+ throw 'Missing the required parameter "metricId" when calling getGamificationScorecardsProfileMetricUsersValuesTrends';
704
+ }
705
+ // verify the required parameter 'filterType' is set
706
+ if (filterType === undefined || filterType === null) {
707
+ throw 'Missing the required parameter "filterType" when calling getGamificationScorecardsProfileMetricUsersValuesTrends';
708
+ }
709
+ // verify the required parameter 'filterId' is set
710
+ if (filterId === undefined || filterId === null) {
711
+ throw 'Missing the required parameter "filterId" when calling getGamificationScorecardsProfileMetricUsersValuesTrends';
712
+ }
713
+ // verify the required parameter 'startWorkday' is set
714
+ if (startWorkday === undefined || startWorkday === null) {
715
+ throw 'Missing the required parameter "startWorkday" when calling getGamificationScorecardsProfileMetricUsersValuesTrends';
716
+ }
717
+ // verify the required parameter 'endWorkday' is set
718
+ if (endWorkday === undefined || endWorkday === null) {
719
+ throw 'Missing the required parameter "endWorkday" when calling getGamificationScorecardsProfileMetricUsersValuesTrends';
720
+ }
721
+
722
+ return this.apiClient.callApi(
723
+ '/api/v2/gamification/scorecards/profiles/{profileId}/metrics/{metricId}/users/values/trends',
724
+ 'GET',
725
+ { 'profileId': profileId,'metricId': metricId },
726
+ { 'filterType': filterType,'filterId': filterId,'startWorkday': startWorkday,'endWorkday': endWorkday,'referenceWorkday': opts['referenceWorkday'],'timeZone': opts['timeZone'] },
727
+ { },
728
+ { },
729
+ null,
730
+ ['PureCloud OAuth'],
731
+ ['application/json'],
732
+ ['application/json']
733
+ );
734
+ }
735
+
736
+ /**
737
+ * Average performance values trends by metric of the requesting user
738
+ *
739
+ * @param {String} profileId performanceProfileId
740
+ * @param {String} metricId metricId
741
+ * @param {String} startWorkday Start workday of querying workdays range. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
742
+ * @param {String} endWorkday End workday of querying workdays range. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
743
+ * @param {Object} opts Optional parameters
744
+ * @param {Object} opts.filterType Filter type for the query request. If not set, returns the values trends of the requesting user
745
+ * @param {String} opts.referenceWorkday Reference workday for the trend. Used to determine the associated metric definition. If not set, then the value of endWorkday is used. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd
746
+ * @param {String} opts.timeZone Timezone for the workday. Defaults to UTC (default to UTC)
747
+ */
748
+ getGamificationScorecardsProfileMetricValuesTrends(profileId, metricId, startWorkday, endWorkday, opts) {
749
+ opts = opts || {};
750
+
751
+ // verify the required parameter 'profileId' is set
752
+ if (profileId === undefined || profileId === null) {
753
+ throw 'Missing the required parameter "profileId" when calling getGamificationScorecardsProfileMetricValuesTrends';
754
+ }
755
+ // verify the required parameter 'metricId' is set
756
+ if (metricId === undefined || metricId === null) {
757
+ throw 'Missing the required parameter "metricId" when calling getGamificationScorecardsProfileMetricValuesTrends';
758
+ }
759
+ // verify the required parameter 'startWorkday' is set
760
+ if (startWorkday === undefined || startWorkday === null) {
761
+ throw 'Missing the required parameter "startWorkday" when calling getGamificationScorecardsProfileMetricValuesTrends';
762
+ }
763
+ // verify the required parameter 'endWorkday' is set
764
+ if (endWorkday === undefined || endWorkday === null) {
765
+ throw 'Missing the required parameter "endWorkday" when calling getGamificationScorecardsProfileMetricValuesTrends';
766
+ }
767
+
768
+ return this.apiClient.callApi(
769
+ '/api/v2/gamification/scorecards/profiles/{profileId}/metrics/{metricId}/values/trends',
770
+ 'GET',
771
+ { 'profileId': profileId,'metricId': metricId },
772
+ { 'filterType': opts['filterType'],'startWorkday': startWorkday,'endWorkday': endWorkday,'referenceWorkday': opts['referenceWorkday'],'timeZone': opts['timeZone'] },
773
+ { },
774
+ { },
775
+ null,
776
+ ['PureCloud OAuth'],
777
+ ['application/json'],
778
+ ['application/json']
779
+ );
780
+ }
781
+
631
782
  /**
632
783
  * Workday performance metrics for a user
633
784
  *
@@ -1080,7 +1231,7 @@ class GamificationApi {
1080
1231
 
1081
1232
  /**
1082
1233
  * Creates a gamified metric with a given metric definition and metric objective
1083
- *
1234
+ * This API is deprecated. Use /api/v2/gamification/profiles/{profileId}/metrics instead.
1084
1235
  * @param {Object} body Metric
1085
1236
  */
1086
1237
  postGamificationMetrics(body) {
@@ -1309,7 +1460,7 @@ class GamificationApi {
1309
1460
 
1310
1461
  /**
1311
1462
  * Updates a metric
1312
- *
1463
+ * This API is deprecated. Use /api/v2/gamification/profiles/{profileId}/metrics/{metricId} instead.
1313
1464
  * @param {String} metricId metric Id
1314
1465
  * @param {Object} body Metric
1315
1466
  * @param {Object} opts Optional parameters
@@ -5,7 +5,7 @@ class GeneralDataProtectionRegulationApi {
5
5
  /**
6
6
  * GeneralDataProtectionRegulation service.
7
7
  * @module purecloud-platform-client-v2/api/GeneralDataProtectionRegulationApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class GeolocationApi {
5
5
  /**
6
6
  * Geolocation service.
7
7
  * @module purecloud-platform-client-v2/api/GeolocationApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class GreetingsApi {
5
5
  /**
6
6
  * Greetings service.
7
7
  * @module purecloud-platform-client-v2/api/GreetingsApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class GroupsApi {
5
5
  /**
6
6
  * Groups service.
7
7
  * @module purecloud-platform-client-v2/api/GroupsApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class IdentityProviderApi {
5
5
  /**
6
6
  * IdentityProvider service.
7
7
  * @module purecloud-platform-client-v2/api/IdentityProviderApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class IntegrationsApi {
5
5
  /**
6
6
  * Integrations service.
7
7
  * @module purecloud-platform-client-v2/api/IntegrationsApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class JourneyApi {
5
5
  /**
6
6
  * Journey service.
7
7
  * @module purecloud-platform-client-v2/api/JourneyApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class KnowledgeApi {
5
5
  /**
6
6
  * Knowledge service.
7
7
  * @module purecloud-platform-client-v2/api/KnowledgeApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class LanguageUnderstandingApi {
5
5
  /**
6
6
  * LanguageUnderstanding service.
7
7
  * @module purecloud-platform-client-v2/api/LanguageUnderstandingApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class LanguagesApi {
5
5
  /**
6
6
  * Languages service.
7
7
  * @module purecloud-platform-client-v2/api/LanguagesApi
8
- * @version 139.0.0
8
+ * @version 141.0.0
9
9
  */
10
10
 
11
11
  /**