purecloud-platform-client-v2 214.0.0 → 216.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 (93) hide show
  1. package/README.md +31 -3
  2. package/dist/node/purecloud-platform-client-v2.js +649 -118
  3. package/dist/web-amd/purecloud-platform-client-v2.js +649 -118
  4. package/dist/web-amd/purecloud-platform-client-v2.min.js +1 -1
  5. package/dist/web-cjs/bundle.js +272 -150
  6. package/dist/web-cjs/purecloud-platform-client-v2.js +283 -158
  7. package/dist/web-cjs/purecloud-platform-client-v2.min.js +1 -1
  8. package/index.d.ts +490 -255
  9. package/package.json +1 -1
  10. package/src/purecloud-platform-client-v2/AbstractHttpClient.js +29 -0
  11. package/src/purecloud-platform-client-v2/ApiClient.js +21 -1
  12. package/src/purecloud-platform-client-v2/DefaultHttpClient.js +41 -0
  13. package/src/purecloud-platform-client-v2/api/AgentAssistantsApi.js +1 -1
  14. package/src/purecloud-platform-client-v2/api/AgentCopilotApi.js +1 -1
  15. package/src/purecloud-platform-client-v2/api/AgentUIApi.js +1 -1
  16. package/src/purecloud-platform-client-v2/api/AlertingApi.js +1 -1
  17. package/src/purecloud-platform-client-v2/api/AnalyticsApi.js +1 -2
  18. package/src/purecloud-platform-client-v2/api/ArchitectApi.js +1 -1
  19. package/src/purecloud-platform-client-v2/api/AuditApi.js +1 -1
  20. package/src/purecloud-platform-client-v2/api/AuthorizationApi.js +379 -1
  21. package/src/purecloud-platform-client-v2/api/BillingApi.js +1 -1
  22. package/src/purecloud-platform-client-v2/api/CarrierServicesApi.js +1 -1
  23. package/src/purecloud-platform-client-v2/api/ChatApi.js +1 -1
  24. package/src/purecloud-platform-client-v2/api/CoachingApi.js +1 -1
  25. package/src/purecloud-platform-client-v2/api/ContentManagementApi.js +1 -1
  26. package/src/purecloud-platform-client-v2/api/ConversationsApi.js +1 -1
  27. package/src/purecloud-platform-client-v2/api/DataExtensionsApi.js +1 -1
  28. package/src/purecloud-platform-client-v2/api/DataPrivacyApi.js +1 -1
  29. package/src/purecloud-platform-client-v2/api/DownloadsApi.js +1 -1
  30. package/src/purecloud-platform-client-v2/api/EmailsApi.js +1 -1
  31. package/src/purecloud-platform-client-v2/api/EmployeeEngagementApi.js +1 -1
  32. package/src/purecloud-platform-client-v2/api/EventsApi.js +1 -1
  33. package/src/purecloud-platform-client-v2/api/ExternalContactsApi.js +9 -4
  34. package/src/purecloud-platform-client-v2/api/FaxApi.js +1 -1
  35. package/src/purecloud-platform-client-v2/api/FlowsApi.js +1 -1
  36. package/src/purecloud-platform-client-v2/api/GamificationApi.js +1 -1
  37. package/src/purecloud-platform-client-v2/api/GeneralDataProtectionRegulationApi.js +1 -1
  38. package/src/purecloud-platform-client-v2/api/GeolocationApi.js +1 -1
  39. package/src/purecloud-platform-client-v2/api/GreetingsApi.js +1 -1
  40. package/src/purecloud-platform-client-v2/api/GroupsApi.js +1 -1
  41. package/src/purecloud-platform-client-v2/api/IdentityProviderApi.js +1 -1
  42. package/src/purecloud-platform-client-v2/api/InfrastructureAsCodeApi.js +1 -1
  43. package/src/purecloud-platform-client-v2/api/IntegrationsApi.js +1 -1
  44. package/src/purecloud-platform-client-v2/api/JourneyApi.js +21 -1
  45. package/src/purecloud-platform-client-v2/api/KnowledgeApi.js +1 -1
  46. package/src/purecloud-platform-client-v2/api/LanguageUnderstandingApi.js +1 -1
  47. package/src/purecloud-platform-client-v2/api/LanguagesApi.js +1 -1
  48. package/src/purecloud-platform-client-v2/api/LearningApi.js +1 -1
  49. package/src/purecloud-platform-client-v2/api/LicenseApi.js +1 -1
  50. package/src/purecloud-platform-client-v2/api/LocationsApi.js +1 -1
  51. package/src/purecloud-platform-client-v2/api/LogCaptureApi.js +1 -1
  52. package/src/purecloud-platform-client-v2/api/MessagingApi.js +1 -1
  53. package/src/purecloud-platform-client-v2/api/MobileDevicesApi.js +1 -1
  54. package/src/purecloud-platform-client-v2/api/NotificationsApi.js +1 -1
  55. package/src/purecloud-platform-client-v2/api/OAuthApi.js +1 -1
  56. package/src/purecloud-platform-client-v2/api/ObjectsApi.js +1 -1
  57. package/src/purecloud-platform-client-v2/api/OperationalEventsApi.js +1 -1
  58. package/src/purecloud-platform-client-v2/api/OrganizationApi.js +1 -1
  59. package/src/purecloud-platform-client-v2/api/OrganizationAuthorizationApi.js +1 -1
  60. package/src/purecloud-platform-client-v2/api/OutboundApi.js +1 -1
  61. package/src/purecloud-platform-client-v2/api/PresenceApi.js +1 -1
  62. package/src/purecloud-platform-client-v2/api/ProcessAutomationApi.js +1 -1
  63. package/src/purecloud-platform-client-v2/api/QualityApi.js +1 -1
  64. package/src/purecloud-platform-client-v2/api/RecordingApi.js +1 -31
  65. package/src/purecloud-platform-client-v2/api/ResponseManagementApi.js +1 -1
  66. package/src/purecloud-platform-client-v2/api/RoutingApi.js +1 -1
  67. package/src/purecloud-platform-client-v2/api/SCIMApi.js +1 -1
  68. package/src/purecloud-platform-client-v2/api/ScreenRecordingApi.js +1 -1
  69. package/src/purecloud-platform-client-v2/api/ScriptsApi.js +1 -1
  70. package/src/purecloud-platform-client-v2/api/SearchApi.js +1 -1
  71. package/src/purecloud-platform-client-v2/api/SettingsApi.js +1 -1
  72. package/src/purecloud-platform-client-v2/api/SocialMediaApi.js +1 -1
  73. package/src/purecloud-platform-client-v2/api/SpeechTextAnalyticsApi.js +3 -3
  74. package/src/purecloud-platform-client-v2/api/StationsApi.js +1 -1
  75. package/src/purecloud-platform-client-v2/api/SuggestApi.js +1 -1
  76. package/src/purecloud-platform-client-v2/api/TaskManagementApi.js +1 -1
  77. package/src/purecloud-platform-client-v2/api/TeamsApi.js +1 -1
  78. package/src/purecloud-platform-client-v2/api/TelephonyApi.js +1 -1
  79. package/src/purecloud-platform-client-v2/api/TelephonyProvidersEdgeApi.js +1 -1
  80. package/src/purecloud-platform-client-v2/api/TextbotsApi.js +1 -1
  81. package/src/purecloud-platform-client-v2/api/TokensApi.js +1 -1
  82. package/src/purecloud-platform-client-v2/api/UploadsApi.js +1 -1
  83. package/src/purecloud-platform-client-v2/api/UsageApi.js +1 -1
  84. package/src/purecloud-platform-client-v2/api/UserRecordingsApi.js +1 -1
  85. package/src/purecloud-platform-client-v2/api/UsersApi.js +1 -1
  86. package/src/purecloud-platform-client-v2/api/UtilitiesApi.js +1 -1
  87. package/src/purecloud-platform-client-v2/api/VoicemailApi.js +1 -1
  88. package/src/purecloud-platform-client-v2/api/WebChatApi.js +1 -1
  89. package/src/purecloud-platform-client-v2/api/WebDeploymentsApi.js +1 -1
  90. package/src/purecloud-platform-client-v2/api/WebMessagingApi.js +1 -1
  91. package/src/purecloud-platform-client-v2/api/WidgetsApi.js +1 -1
  92. package/src/purecloud-platform-client-v2/api/WorkforceManagementApi.js +70 -1
  93. 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": "214.0.0",
3
+ "version": "216.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",
@@ -21,6 +21,35 @@ class AbstractHttpClient {
21
21
  request(httpRequestOptions) {
22
22
  throw new Error("method must be implemented");
23
23
  }
24
+
25
+ enableHooks() {
26
+ throw new Error("method must be implemented");
27
+ }
28
+
29
+ /**
30
+ * Set a PreHook function that modifies the request config before execution.
31
+ * @param {(config: object) => object | Promise<object> | void} hookFunction
32
+ */
33
+ setPreHook(hookFunction) {
34
+ if (typeof hookFunction !== "function" || hookFunction.length !== 1) {
35
+ throw new Error("preHook must be a function that accepts (config)");
36
+ }
37
+ this.preHook = hookFunction;
38
+ this.enableHooks()
39
+ }
40
+
41
+ /**
42
+ * Set a PostHook function that processes the response or error after execution.
43
+ * @param {(response: object | null, error: Error | null) => object | Promise<object> | void} hookFunction
44
+ */
45
+ setPostHook(hookFunction) {
46
+ if (typeof hookFunction !== "function" || hookFunction.length !== 1) {
47
+ throw new Error("postHook must be a function that accepts (response)");
48
+ }
49
+ this.postHook = hookFunction;
50
+ this.enableHooks()
51
+ }
52
+
24
53
  }
25
54
 
26
55
  export default AbstractHttpClient;
@@ -6,7 +6,7 @@ import { default as qs } from 'qs';
6
6
 
7
7
  /**
8
8
  * @module purecloud-platform-client-v2/ApiClient
9
- * @version 214.0.0
9
+ * @version 216.0.0
10
10
  */
11
11
  class ApiClient {
12
12
  /**
@@ -261,6 +261,24 @@ class ApiClient {
261
261
  }
262
262
  }
263
263
 
264
+ /**
265
+ * @description Sets preHook functions for the httpClient
266
+ * @param {string} preHook - method definition for prehook
267
+ */
268
+ setPreHook(preHook) {
269
+ const httpClient = this.getHttpClient();
270
+ httpClient.setPreHook(preHook);
271
+ }
272
+
273
+ /**
274
+ * @description Sets postHook functions for the httpClient
275
+ * @param {string} postHook - method definition for posthook
276
+ */
277
+ setPostHook(postHook) {
278
+ const httpClient = this.getHttpClient();
279
+ httpClient.setPostHook(postHook);
280
+ }
281
+
264
282
  /**
265
283
  * @description Sets the certificate content if MTLS authentication is needed
266
284
  * @param {string} certContent - content for certs
@@ -292,6 +310,8 @@ class ApiClient {
292
310
  }
293
311
  }
294
312
 
313
+
314
+
295
315
  /**
296
316
  * @description Sets the gateway used by the session
297
317
  * @param {object} gateway - Gateway Configuration interface
@@ -14,6 +14,47 @@ class DefaultHttpClient extends AbstractHttpClient{
14
14
  this._axiosInstance = axios.create({});
15
15
  }
16
16
 
17
+
18
+ enableHooks() {
19
+ if (this.preHook && typeof this.preHook === 'function') {
20
+
21
+ if (this.requestInterceptorId !== undefined) {
22
+ axios.interceptors.request.eject(this.requestInterceptorId);
23
+ }
24
+
25
+ this.requestInterceptorId = this._axiosInstance.interceptors.request.use(
26
+ async (config) => {
27
+ config = await this.preHook(config); // Call the custom pre-hook
28
+ return config
29
+ },
30
+ (error) => {
31
+ // Handle errors before the request is sent
32
+ console.error('Request Pre-Hook Error:', error.message);
33
+ return Promise.reject(error);
34
+ }
35
+ );
36
+ }
37
+
38
+ if (this.postHook && typeof this.postHook === 'function') {
39
+ // Response interceptor (for post-hooks)
40
+ if (this.responseInterceptorId !== undefined) {
41
+ axios.interceptors.response.eject(this.responseInterceptorId);
42
+ }
43
+
44
+ this.responseInterceptorId = this._axiosInstance.interceptors.response.use(
45
+ async (response) => {
46
+ response = await this.postHook(response); // Call the custom post-hook
47
+ return response
48
+ },
49
+ async (error) => {
50
+ console.error('Post-Hook: Response Error', error.message);
51
+ // Optionally call post-hook in case of errors
52
+ return Promise.reject(error);
53
+ }
54
+ );
55
+ }
56
+ }
57
+
17
58
  request(httpRequestOptions) {
18
59
  if(!(httpRequestOptions instanceof HttpRequestOptions)) {
19
60
  throw new Error(`httpRequestOptions must be instance of HttpRequestOptions `);
@@ -5,7 +5,7 @@ class AgentAssistantsApi {
5
5
  /**
6
6
  * AgentAssistants service.
7
7
  * @module purecloud-platform-client-v2/api/AgentAssistantsApi
8
- * @version 214.0.0
8
+ * @version 216.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class AgentCopilotApi {
5
5
  /**
6
6
  * AgentCopilot service.
7
7
  * @module purecloud-platform-client-v2/api/AgentCopilotApi
8
- * @version 214.0.0
8
+ * @version 216.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class AgentUIApi {
5
5
  /**
6
6
  * AgentUI service.
7
7
  * @module purecloud-platform-client-v2/api/AgentUIApi
8
- * @version 214.0.0
8
+ * @version 216.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class AlertingApi {
5
5
  /**
6
6
  * Alerting service.
7
7
  * @module purecloud-platform-client-v2/api/AlertingApi
8
- * @version 214.0.0
8
+ * @version 216.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 214.0.0
8
+ * @version 216.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -2438,7 +2438,6 @@ class AnalyticsApi {
2438
2438
  * Query for summary aggregates
2439
2439
  *
2440
2440
  * @param {Object} body query
2441
- * postAnalyticsSummariesAggregatesQuery is a preview method and is subject to both breaking and non-breaking changes at any time without notice
2442
2441
  */
2443
2442
  postAnalyticsSummariesAggregatesQuery(body) {
2444
2443
  // verify the required parameter 'body' is set
@@ -5,7 +5,7 @@ class ArchitectApi {
5
5
  /**
6
6
  * Architect service.
7
7
  * @module purecloud-platform-client-v2/api/ArchitectApi
8
- * @version 214.0.0
8
+ * @version 216.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 214.0.0
8
+ * @version 216.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 214.0.0
8
+ * @version 216.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -49,6 +49,37 @@ class AuthorizationApi {
49
49
  );
50
50
  }
51
51
 
52
+ /**
53
+ * Delete an access control policy
54
+ *
55
+ * @param {String} targetName The domain:entity:action target to which the policy is applied
56
+ * @param {String} subjectId The ID of the subject to which the policy is applied
57
+ * deleteAuthorizationPoliciesTargetSubjectSubjectId is a preview method and is subject to both breaking and non-breaking changes at any time without notice
58
+ */
59
+ deleteAuthorizationPoliciesTargetSubjectSubjectId(targetName, subjectId) {
60
+ // verify the required parameter 'targetName' is set
61
+ if (targetName === undefined || targetName === null) {
62
+ throw 'Missing the required parameter "targetName" when calling deleteAuthorizationPoliciesTargetSubjectSubjectId';
63
+ }
64
+ // verify the required parameter 'subjectId' is set
65
+ if (subjectId === undefined || subjectId === null) {
66
+ throw 'Missing the required parameter "subjectId" when calling deleteAuthorizationPoliciesTargetSubjectSubjectId';
67
+ }
68
+
69
+ return this.apiClient.callApi(
70
+ '/api/v2/authorization/policies/targets/{targetName}/subject/{subjectId}',
71
+ 'DELETE',
72
+ { 'targetName': targetName,'subjectId': subjectId },
73
+ { },
74
+ { },
75
+ { },
76
+ null,
77
+ ['PureCloud OAuth'],
78
+ ['application/json'],
79
+ ['application/json']
80
+ );
81
+ }
82
+
52
83
  /**
53
84
  * Delete an organization role.
54
85
  *
@@ -363,6 +394,198 @@ class AuthorizationApi {
363
394
  );
364
395
  }
365
396
 
397
+ /**
398
+ * Get a page of access policies for an organization
399
+ *
400
+ * @param {Object} opts Optional parameters
401
+ * @param {String} opts.after The cursor that points to the end of the set of entities that has been returned.
402
+ * @param {Number} opts.pageSize Number of entities to return. Maximum of 200. (default to 25)
403
+ * getAuthorizationPolicies is a preview method and is subject to both breaking and non-breaking changes at any time without notice
404
+ */
405
+ getAuthorizationPolicies(opts) {
406
+ opts = opts || {};
407
+
408
+
409
+ return this.apiClient.callApi(
410
+ '/api/v2/authorization/policies',
411
+ 'GET',
412
+ { },
413
+ { 'after': opts['after'],'pageSize': opts['pageSize'] },
414
+ { },
415
+ { },
416
+ null,
417
+ ['PureCloud OAuth'],
418
+ ['application/json'],
419
+ ['application/json']
420
+ );
421
+ }
422
+
423
+ /**
424
+ * Get a page of access policies for a given subject
425
+ *
426
+ * @param {String} subjectId The ID of the subject to which policies are applied
427
+ * @param {Object} opts Optional parameters
428
+ * @param {String} opts.after The cursor that points to the end of the set of entities that has been returned.
429
+ * @param {Number} opts.pageSize Number of entities to return. Maximum of 200. (default to 25)
430
+ * getAuthorizationPoliciesSubjectSubjectId is a preview method and is subject to both breaking and non-breaking changes at any time without notice
431
+ */
432
+ getAuthorizationPoliciesSubjectSubjectId(subjectId, opts) {
433
+ opts = opts || {};
434
+
435
+ // verify the required parameter 'subjectId' is set
436
+ if (subjectId === undefined || subjectId === null) {
437
+ throw 'Missing the required parameter "subjectId" when calling getAuthorizationPoliciesSubjectSubjectId';
438
+ }
439
+
440
+ return this.apiClient.callApi(
441
+ '/api/v2/authorization/policies/subject/{subjectId}',
442
+ 'GET',
443
+ { 'subjectId': subjectId },
444
+ { 'after': opts['after'],'pageSize': opts['pageSize'] },
445
+ { },
446
+ { },
447
+ null,
448
+ ['PureCloud OAuth'],
449
+ ['application/json'],
450
+ ['application/json']
451
+ );
452
+ }
453
+
454
+ /**
455
+ * Get a page of access policies for a given policy target
456
+ *
457
+ * @param {String} targetName The domain:entity:action resource target to which policies are applied
458
+ * @param {Object} opts Optional parameters
459
+ * @param {String} opts.after The cursor that points to the end of the set of entities that has been returned.
460
+ * @param {Number} opts.pageSize Number of entities to return. Maximum of 200. (default to 25)
461
+ * getAuthorizationPoliciesTarget is a preview method and is subject to both breaking and non-breaking changes at any time without notice
462
+ */
463
+ getAuthorizationPoliciesTarget(targetName, opts) {
464
+ opts = opts || {};
465
+
466
+ // verify the required parameter 'targetName' is set
467
+ if (targetName === undefined || targetName === null) {
468
+ throw 'Missing the required parameter "targetName" when calling getAuthorizationPoliciesTarget';
469
+ }
470
+
471
+ return this.apiClient.callApi(
472
+ '/api/v2/authorization/policies/targets/{targetName}',
473
+ 'GET',
474
+ { 'targetName': targetName },
475
+ { 'after': opts['after'],'pageSize': opts['pageSize'] },
476
+ { },
477
+ { },
478
+ null,
479
+ ['PureCloud OAuth'],
480
+ ['application/json'],
481
+ ['application/json']
482
+ );
483
+ }
484
+
485
+ /**
486
+ * Get an access control policy for a specified resource target and subject
487
+ *
488
+ * @param {String} targetName The domain:entity:action resource target to which the policy is applied
489
+ * @param {String} subjectId The ID of the subject to which the policy is applied
490
+ * getAuthorizationPoliciesTargetSubjectSubjectId is a preview method and is subject to both breaking and non-breaking changes at any time without notice
491
+ */
492
+ getAuthorizationPoliciesTargetSubjectSubjectId(targetName, subjectId) {
493
+ // verify the required parameter 'targetName' is set
494
+ if (targetName === undefined || targetName === null) {
495
+ throw 'Missing the required parameter "targetName" when calling getAuthorizationPoliciesTargetSubjectSubjectId';
496
+ }
497
+ // verify the required parameter 'subjectId' is set
498
+ if (subjectId === undefined || subjectId === null) {
499
+ throw 'Missing the required parameter "subjectId" when calling getAuthorizationPoliciesTargetSubjectSubjectId';
500
+ }
501
+
502
+ return this.apiClient.callApi(
503
+ '/api/v2/authorization/policies/targets/{targetName}/subject/{subjectId}',
504
+ 'GET',
505
+ { 'targetName': targetName,'subjectId': subjectId },
506
+ { },
507
+ { },
508
+ { },
509
+ null,
510
+ ['PureCloud OAuth'],
511
+ ['application/json'],
512
+ ['application/json']
513
+ );
514
+ }
515
+
516
+ /**
517
+ * Get a map of policy targets to valid attributes for those targets
518
+ *
519
+ * getAuthorizationPoliciesTargets is a preview method and is subject to both breaking and non-breaking changes at any time without notice
520
+ */
521
+ getAuthorizationPoliciesTargets() {
522
+
523
+ return this.apiClient.callApi(
524
+ '/api/v2/authorization/policies/targets',
525
+ 'GET',
526
+ { },
527
+ { },
528
+ { },
529
+ { },
530
+ null,
531
+ ['PureCloud OAuth'],
532
+ ['application/json'],
533
+ ['application/json']
534
+ );
535
+ }
536
+
537
+ /**
538
+ * Get an access control policy with the specified policy ID
539
+ *
540
+ * @param {String} policyId The ID of the policy to retrieve
541
+ * getAuthorizationPolicy is a preview method and is subject to both breaking and non-breaking changes at any time without notice
542
+ */
543
+ getAuthorizationPolicy(policyId) {
544
+ // verify the required parameter 'policyId' is set
545
+ if (policyId === undefined || policyId === null) {
546
+ throw 'Missing the required parameter "policyId" when calling getAuthorizationPolicy';
547
+ }
548
+
549
+ return this.apiClient.callApi(
550
+ '/api/v2/authorization/policies/{policyId}',
551
+ 'GET',
552
+ { 'policyId': policyId },
553
+ { },
554
+ { },
555
+ { },
556
+ null,
557
+ ['PureCloud OAuth'],
558
+ ['application/json'],
559
+ ['application/json']
560
+ );
561
+ }
562
+
563
+ /**
564
+ * Get the list of attributes used to evaluate an access control policy with the specified policy ID
565
+ *
566
+ * @param {String} policyId The ID of the policy to retrieve attributes
567
+ * getAuthorizationPolicyAttributes is a preview method and is subject to both breaking and non-breaking changes at any time without notice
568
+ */
569
+ getAuthorizationPolicyAttributes(policyId) {
570
+ // verify the required parameter 'policyId' is set
571
+ if (policyId === undefined || policyId === null) {
572
+ throw 'Missing the required parameter "policyId" when calling getAuthorizationPolicyAttributes';
573
+ }
574
+
575
+ return this.apiClient.callApi(
576
+ '/api/v2/authorization/policies/{policyId}/attributes',
577
+ 'GET',
578
+ { 'policyId': policyId },
579
+ { },
580
+ { },
581
+ { },
582
+ null,
583
+ ['PureCloud OAuth'],
584
+ ['application/json'],
585
+ ['application/json']
586
+ );
587
+ }
588
+
366
589
  /**
367
590
  * Get the list of enabled products
368
591
  * Gets the list of enabled products. Some example product names are: collaborateFree, collaboratePro, communicate, and engage.
@@ -827,6 +1050,99 @@ class AuthorizationApi {
827
1050
  );
828
1051
  }
829
1052
 
1053
+ /**
1054
+ * Add an access control policy for a specified resource target and subject
1055
+ *
1056
+ * @param {String} targetName The domain:entity:action target to which the policy will be applied
1057
+ * @param {Object} body Access control policy
1058
+ * postAuthorizationPoliciesTarget is a preview method and is subject to both breaking and non-breaking changes at any time without notice
1059
+ */
1060
+ postAuthorizationPoliciesTarget(targetName, body) {
1061
+ // verify the required parameter 'targetName' is set
1062
+ if (targetName === undefined || targetName === null) {
1063
+ throw 'Missing the required parameter "targetName" when calling postAuthorizationPoliciesTarget';
1064
+ }
1065
+ // verify the required parameter 'body' is set
1066
+ if (body === undefined || body === null) {
1067
+ throw 'Missing the required parameter "body" when calling postAuthorizationPoliciesTarget';
1068
+ }
1069
+
1070
+ return this.apiClient.callApi(
1071
+ '/api/v2/authorization/policies/targets/{targetName}',
1072
+ 'POST',
1073
+ { 'targetName': targetName },
1074
+ { },
1075
+ { },
1076
+ { },
1077
+ body,
1078
+ ['PureCloud OAuth'],
1079
+ ['application/json'],
1080
+ ['application/json']
1081
+ );
1082
+ }
1083
+
1084
+ /**
1085
+ * Validate the conditions and attributes of an access control policy for a specified resource target
1086
+ *
1087
+ * @param {String} targetName The domain:entity:action target to which the policy will be applied
1088
+ * @param {Object} body Access control policy
1089
+ * postAuthorizationPoliciesTargetValidate is a preview method and is subject to both breaking and non-breaking changes at any time without notice
1090
+ */
1091
+ postAuthorizationPoliciesTargetValidate(targetName, body) {
1092
+ // verify the required parameter 'targetName' is set
1093
+ if (targetName === undefined || targetName === null) {
1094
+ throw 'Missing the required parameter "targetName" when calling postAuthorizationPoliciesTargetValidate';
1095
+ }
1096
+ // verify the required parameter 'body' is set
1097
+ if (body === undefined || body === null) {
1098
+ throw 'Missing the required parameter "body" when calling postAuthorizationPoliciesTargetValidate';
1099
+ }
1100
+
1101
+ return this.apiClient.callApi(
1102
+ '/api/v2/authorization/policies/targets/{targetName}/validate',
1103
+ 'POST',
1104
+ { 'targetName': targetName },
1105
+ { },
1106
+ { },
1107
+ { },
1108
+ body,
1109
+ ['PureCloud OAuth'],
1110
+ ['application/json'],
1111
+ ['application/json']
1112
+ );
1113
+ }
1114
+
1115
+ /**
1116
+ * Simulate a request and evaluate the specified policy ID against the provided values
1117
+ *
1118
+ * @param {String} policyId The ID of the policy to test the simulated data against
1119
+ * @param {Object} body A map of attribute names to type and simulated data value
1120
+ * postAuthorizationPolicySimulate is a preview method and is subject to both breaking and non-breaking changes at any time without notice
1121
+ */
1122
+ postAuthorizationPolicySimulate(policyId, body) {
1123
+ // verify the required parameter 'policyId' is set
1124
+ if (policyId === undefined || policyId === null) {
1125
+ throw 'Missing the required parameter "policyId" when calling postAuthorizationPolicySimulate';
1126
+ }
1127
+ // verify the required parameter 'body' is set
1128
+ if (body === undefined || body === null) {
1129
+ throw 'Missing the required parameter "body" when calling postAuthorizationPolicySimulate';
1130
+ }
1131
+
1132
+ return this.apiClient.callApi(
1133
+ '/api/v2/authorization/policies/{policyId}/simulate',
1134
+ 'POST',
1135
+ { 'policyId': policyId },
1136
+ { },
1137
+ { },
1138
+ { },
1139
+ body,
1140
+ ['PureCloud OAuth'],
1141
+ ['application/json'],
1142
+ ['application/json']
1143
+ );
1144
+ }
1145
+
830
1146
  /**
831
1147
  * Bulk-grant subjects and divisions with an organization role.
832
1148
  *
@@ -1112,6 +1428,68 @@ class AuthorizationApi {
1112
1428
  );
1113
1429
  }
1114
1430
 
1431
+ /**
1432
+ * Add an access control policy for a specified resource target and subject, overwriting any existing policy
1433
+ *
1434
+ * @param {String} targetName The domain:entity:action target to which the policy will be applied
1435
+ * @param {Object} body Access control policy
1436
+ * putAuthorizationPoliciesTarget is a preview method and is subject to both breaking and non-breaking changes at any time without notice
1437
+ */
1438
+ putAuthorizationPoliciesTarget(targetName, body) {
1439
+ // verify the required parameter 'targetName' is set
1440
+ if (targetName === undefined || targetName === null) {
1441
+ throw 'Missing the required parameter "targetName" when calling putAuthorizationPoliciesTarget';
1442
+ }
1443
+ // verify the required parameter 'body' is set
1444
+ if (body === undefined || body === null) {
1445
+ throw 'Missing the required parameter "body" when calling putAuthorizationPoliciesTarget';
1446
+ }
1447
+
1448
+ return this.apiClient.callApi(
1449
+ '/api/v2/authorization/policies/targets/{targetName}',
1450
+ 'PUT',
1451
+ { 'targetName': targetName },
1452
+ { },
1453
+ { },
1454
+ { },
1455
+ body,
1456
+ ['PureCloud OAuth'],
1457
+ ['application/json'],
1458
+ ['application/json']
1459
+ );
1460
+ }
1461
+
1462
+ /**
1463
+ * Update an access control policy with a given ID
1464
+ *
1465
+ * @param {String} policyId The ID of the policy to update
1466
+ * @param {Object} body Access control policy
1467
+ * putAuthorizationPolicy is a preview method and is subject to both breaking and non-breaking changes at any time without notice
1468
+ */
1469
+ putAuthorizationPolicy(policyId, body) {
1470
+ // verify the required parameter 'policyId' is set
1471
+ if (policyId === undefined || policyId === null) {
1472
+ throw 'Missing the required parameter "policyId" when calling putAuthorizationPolicy';
1473
+ }
1474
+ // verify the required parameter 'body' is set
1475
+ if (body === undefined || body === null) {
1476
+ throw 'Missing the required parameter "body" when calling putAuthorizationPolicy';
1477
+ }
1478
+
1479
+ return this.apiClient.callApi(
1480
+ '/api/v2/authorization/policies/{policyId}',
1481
+ 'PUT',
1482
+ { 'policyId': policyId },
1483
+ { },
1484
+ { },
1485
+ { },
1486
+ body,
1487
+ ['PureCloud OAuth'],
1488
+ ['application/json'],
1489
+ ['application/json']
1490
+ );
1491
+ }
1492
+
1115
1493
  /**
1116
1494
  * Update an organization role.
1117
1495
  * Update
@@ -5,7 +5,7 @@ class BillingApi {
5
5
  /**
6
6
  * Billing service.
7
7
  * @module purecloud-platform-client-v2/api/BillingApi
8
- * @version 214.0.0
8
+ * @version 216.0.0
9
9
  */
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ class CarrierServicesApi {
5
5
  /**
6
6
  * CarrierServices service.
7
7
  * @module purecloud-platform-client-v2/api/CarrierServicesApi
8
- * @version 214.0.0
8
+ * @version 216.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 214.0.0
8
+ * @version 216.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 214.0.0
8
+ * @version 216.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 214.0.0
8
+ * @version 216.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 214.0.0
8
+ * @version 216.0.0
9
9
  */
10
10
 
11
11
  /**