diff --git a/README.md b/README.md index 34ce9acd..2cbe33a9 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ For direct use in a browser script: ```html - + diff --git a/build/.openapi-generator/FILES b/build/.openapi-generator/FILES index 862283c3..32f59eec 100644 --- a/build/.openapi-generator/FILES +++ b/build/.openapi-generator/FILES @@ -1616,6 +1616,7 @@ docs/patchCoachingNotification-example.txt docs/patchConversationParticipant-example.txt docs/patchConversationParticipantAttributes-example.txt docs/patchConversationSecureattributes-example.txt +docs/patchConversationUtilizationlabel-example.txt docs/patchConversationsAftercallworkConversationIdParticipantCommunication-example.txt docs/patchConversationsCall-example.txt docs/patchConversationsCallParticipant-example.txt diff --git a/build/APIData.json b/build/APIData.json index 662bc43c..1ebfdf0d 100644 --- a/build/APIData.json +++ b/build/APIData.json @@ -10100,6 +10100,25 @@ "return": "'String'", "example": "const platformClient = require(\"purecloud-platform-client-v2\");\n\nconst client = platformClient.ApiClient.instance;\nclient.setEnvironment(platformClient.PureCloudRegionHosts.us_east_1); // Genesys Cloud region\n\n// Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...)\nclient.setAccessToken(\"your_access_token\");\n\nlet apiInstance = new platformClient.ConversationsApi();\n\nlet conversationId = \"conversationId_example\"; // String | conversation ID\nlet body = {}; // Object | Conversation Secure Attributes\n\n// Update the secure attributes on a conversation.\napiInstance.patchConversationSecureattributes(conversationId, body)\n .then((data) => {\n console.log(`patchConversationSecureattributes success! data: ${JSON.stringify(data, null, 2)}`);\n })\n .catch((err) => {\n console.log(\"There was a failure calling patchConversationSecureattributes\");\n console.error(err);\n });" }, + "patchconversationutilizationlabel": { + "operationId": "patchconversationutilizationlabel", + "functionName": "patchConversationUtilizationlabel", + "signature": "patchConversationUtilizationlabel(conversationId, body)", + "parameters": [ + { + "name": "conversationId", + "type": "String", + "required": "true" + }, + { + "name": "body", + "type": "Object", + "required": "true" + } + ], + "return": "'String'", + "example": "const platformClient = require(\"purecloud-platform-client-v2\");\n\nconst client = platformClient.ApiClient.instance;\nclient.setEnvironment(platformClient.PureCloudRegionHosts.us_east_1); // Genesys Cloud region\n\n// Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...)\nclient.setAccessToken(\"your_access_token\");\n\nlet apiInstance = new platformClient.ConversationsApi();\n\nlet conversationId = \"conversationId_example\"; // String | conversation ID\nlet body = {}; // Object | Conversation Utilization Label\n\n// Update the utilization label on a conversation. When there is no value provided, the system default label is applied\napiInstance.patchConversationUtilizationlabel(conversationId, body)\n .then((data) => {\n console.log(`patchConversationUtilizationlabel success! data: ${JSON.stringify(data, null, 2)}`);\n })\n .catch((err) => {\n console.log(\"There was a failure calling patchConversationUtilizationlabel\");\n console.error(err);\n });" + }, "patchconversationsaftercallworkconversationidparticipantcommunication": { "operationId": "patchconversationsaftercallworkconversationidparticipantcommunication", "functionName": "patchConversationsAftercallworkConversationIdParticipantCommunication", diff --git a/build/README.md b/build/README.md index 34ce9acd..2cbe33a9 100644 --- a/build/README.md +++ b/build/README.md @@ -31,7 +31,7 @@ For direct use in a browser script: ```html - + diff --git a/build/dist/node/purecloud-platform-client-v2.js b/build/dist/node/purecloud-platform-client-v2.js index 0ffd508b..8e4061dd 100644 --- a/build/dist/node/purecloud-platform-client-v2.js +++ b/build/dist/node/purecloud-platform-client-v2.js @@ -402,7 +402,7 @@ class Configuration { /** * @module purecloud-platform-client-v2/ApiClient - * @version 192.0.0 + * @version 192.1.0 */ class ApiClient { /** @@ -1821,7 +1821,7 @@ class AlertingApi { /** * Alerting service. * @module purecloud-platform-client-v2/api/AlertingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -2482,7 +2482,7 @@ class AnalyticsApi { /** * Analytics service. * @module purecloud-platform-client-v2/api/AnalyticsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -5256,7 +5256,7 @@ class ArchitectApi { /** * Architect service. * @module purecloud-platform-client-v2/api/ArchitectApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -9402,7 +9402,7 @@ class AuditApi { /** * Audit service. * @module purecloud-platform-client-v2/api/AuditApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -9573,7 +9573,7 @@ class AuthorizationApi { /** * Authorization service. * @module purecloud-platform-client-v2/api/AuthorizationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -10811,7 +10811,7 @@ class BillingApi { /** * Billing service. * @module purecloud-platform-client-v2/api/BillingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -10891,7 +10891,7 @@ class CarrierServicesApi { /** * CarrierServices service. * @module purecloud-platform-client-v2/api/CarrierServicesApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -10961,7 +10961,7 @@ class ChatApi { /** * Chat service. * @module purecloud-platform-client-v2/api/ChatApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -11850,7 +11850,7 @@ class CoachingApi { /** * Coaching service. * @module purecloud-platform-client-v2/api/CoachingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -12427,7 +12427,7 @@ class ContentManagementApi { /** * ContentManagement service. * @module purecloud-platform-client-v2/api/ContentManagementApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -13509,7 +13509,7 @@ class ConversationsApi { /** * Conversations service. * @module purecloud-platform-client-v2/api/ConversationsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -16498,6 +16498,37 @@ class ConversationsApi { ); } + /** + * Update the utilization label on a conversation. When there is no value provided, the system default label is applied + * + * @param {String} conversationId conversation ID + * @param {Object} body Conversation Utilization Label + * patchConversationUtilizationlabel is a preview method and is subject to both breaking and non-breaking changes at any time without notice + */ + patchConversationUtilizationlabel(conversationId, body) { + // verify the required parameter 'conversationId' is set + if (conversationId === undefined || conversationId === null) { + throw 'Missing the required parameter "conversationId" when calling patchConversationUtilizationlabel'; + } + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw 'Missing the required parameter "body" when calling patchConversationUtilizationlabel'; + } + + return this.apiClient.callApi( + '/api/v2/conversations/{conversationId}/utilizationlabel', + 'PATCH', + { 'conversationId': conversationId }, + { }, + { }, + { }, + body, + ['PureCloud OAuth'], + ['application/json'], + ['application/json'] + ); + } + /** * Update after-call work for this conversation communication. * @@ -20720,7 +20751,7 @@ class DataExtensionsApi { /** * DataExtensions service. * @module purecloud-platform-client-v2/api/DataExtensionsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -20806,7 +20837,7 @@ class DownloadsApi { /** * Downloads service. * @module purecloud-platform-client-v2/api/DownloadsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -20858,7 +20889,7 @@ class EmailsApi { /** * Emails service. * @module purecloud-platform-client-v2/api/EmailsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -20923,7 +20954,7 @@ class EventsApi { /** * Events service. * @module purecloud-platform-client-v2/api/EventsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -21019,7 +21050,7 @@ class ExternalContactsApi { /** * ExternalContacts service. * @module purecloud-platform-client-v2/api/ExternalContactsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -22977,7 +23008,7 @@ class FaxApi { /** * Fax service. * @module purecloud-platform-client-v2/api/FaxApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -23192,7 +23223,7 @@ class FlowsApi { /** * Flows service. * @module purecloud-platform-client-v2/api/FlowsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -23376,7 +23407,7 @@ class GamificationApi { /** * Gamification service. * @module purecloud-platform-client-v2/api/GamificationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -25462,7 +25493,7 @@ class GeneralDataProtectionRegulationApi { /** * GeneralDataProtectionRegulation service. * @module purecloud-platform-client-v2/api/GeneralDataProtectionRegulationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -25592,7 +25623,7 @@ class GeolocationApi { /** * Geolocation service. * @module purecloud-platform-client-v2/api/GeolocationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -25723,7 +25754,7 @@ class GreetingsApi { /** * Greetings service. * @module purecloud-platform-client-v2/api/GreetingsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -26178,7 +26209,7 @@ class GroupsApi { /** * Groups service. * @module purecloud-platform-client-v2/api/GroupsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -26697,7 +26728,7 @@ class IdentityProviderApi { /** * IdentityProvider service. * @module purecloud-platform-client-v2/api/IdentityProviderApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -27558,7 +27589,7 @@ class InfrastructureAsCodeApi { /** * InfrastructureAsCode service. * @module purecloud-platform-client-v2/api/InfrastructureAsCodeApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -27725,7 +27756,7 @@ class IntegrationsApi { /** * Integrations service. * @module purecloud-platform-client-v2/api/IntegrationsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -30077,7 +30108,7 @@ class JourneyApi { /** * Journey service. * @module purecloud-platform-client-v2/api/JourneyApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -31431,7 +31462,6 @@ class JourneyApi { * * @param {Object} opts Optional parameters * @param {Object} opts.body - * postJourneyFlowsPathsQuery is a preview method and is subject to both breaking and non-breaking changes at any time without notice */ postJourneyFlowsPathsQuery(opts) { opts = opts || {}; @@ -31667,7 +31697,7 @@ class KnowledgeApi { /** * Knowledge service. * @module purecloud-platform-client-v2/api/KnowledgeApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -34910,7 +34940,7 @@ class LanguageUnderstandingApi { /** * LanguageUnderstanding service. * @module purecloud-platform-client-v2/api/LanguageUnderstandingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -35944,7 +35974,7 @@ class LanguagesApi { /** * Languages service. * @module purecloud-platform-client-v2/api/LanguagesApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -36166,7 +36196,7 @@ class LearningApi { /** * Learning service. * @module purecloud-platform-client-v2/api/LearningApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -37021,7 +37051,7 @@ class LicenseApi { /** * License service. * @module purecloud-platform-client-v2/api/LicenseApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -37259,7 +37289,7 @@ class LocationsApi { /** * Locations service. * @module purecloud-platform-client-v2/api/LocationsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -37495,7 +37525,7 @@ class LogCaptureApi { /** * LogCapture service. * @module purecloud-platform-client-v2/api/LogCaptureApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -37695,7 +37725,7 @@ class MessagingApi { /** * Messaging service. * @module purecloud-platform-client-v2/api/MessagingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -38054,7 +38084,7 @@ class MobileDevicesApi { /** * MobileDevices service. * @module purecloud-platform-client-v2/api/MobileDevicesApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -38205,7 +38235,7 @@ class NotificationsApi { /** * Notifications service. * @module purecloud-platform-client-v2/api/NotificationsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -38438,7 +38468,7 @@ class OAuthApi { /** * OAuth service. * @module purecloud-platform-client-v2/api/OAuthApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -38804,7 +38834,7 @@ class ObjectsApi { /** * Objects service. * @module purecloud-platform-client-v2/api/ObjectsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -39074,7 +39104,7 @@ class OperationalEventsApi { /** * OperationalEvents service. * @module purecloud-platform-client-v2/api/OperationalEventsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -39140,7 +39170,7 @@ class OrganizationApi { /** * Organization service. * @module purecloud-platform-client-v2/api/OrganizationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -39595,7 +39625,7 @@ class OrganizationAuthorizationApi { /** * OrganizationAuthorization service. * @module purecloud-platform-client-v2/api/OrganizationAuthorizationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -40942,7 +40972,7 @@ class OutboundApi { /** * Outbound service. * @module purecloud-platform-client-v2/api/OutboundApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -45184,7 +45214,7 @@ class PresenceApi { /** * Presence service. * @module purecloud-platform-client-v2/api/PresenceApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -45928,7 +45958,7 @@ class ProcessAutomationApi { /** * ProcessAutomation service. * @module purecloud-platform-client-v2/api/ProcessAutomationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -46167,7 +46197,7 @@ class QualityApi { /** * Quality service. * @module purecloud-platform-client-v2/api/QualityApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -47924,7 +47954,7 @@ class RecordingApi { /** * Recording service. * @module purecloud-platform-client-v2/api/RecordingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -48837,7 +48867,6 @@ class RecordingApi { /** * Retrieves an object containing the total number of concurrent active screen recordings * - * getRecordingsScreensessionsDetails is a preview method and is subject to both breaking and non-breaking changes at any time without notice */ getRecordingsScreensessionsDetails() { @@ -49583,7 +49612,7 @@ class ResponseManagementApi { /** * ResponseManagement service. * @module purecloud-platform-client-v2/api/ResponseManagementApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -50093,7 +50122,7 @@ class RoutingApi { /** * Routing service. * @module purecloud-platform-client-v2/api/RoutingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -54073,7 +54102,7 @@ class SCIMApi { /** * SCIM service. * @module purecloud-platform-client-v2/api/SCIMApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -54950,7 +54979,7 @@ class ScreenRecordingApi { /** * ScreenRecording service. * @module purecloud-platform-client-v2/api/ScreenRecordingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -54995,7 +55024,7 @@ class ScriptsApi { /** * Scripts service. * @module purecloud-platform-client-v2/api/ScriptsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -55439,7 +55468,7 @@ class SearchApi { /** * Search service. * @module purecloud-platform-client-v2/api/SearchApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -56128,7 +56157,7 @@ class SettingsApi { /** * Settings service. * @module purecloud-platform-client-v2/api/SettingsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -56240,7 +56269,7 @@ class SpeechTextAnalyticsApi { /** * SpeechTextAnalytics service. * @module purecloud-platform-client-v2/api/SpeechTextAnalyticsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -57354,7 +57383,7 @@ class StationsApi { /** * Stations service. * @module purecloud-platform-client-v2/api/StationsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -57456,7 +57485,7 @@ class SuggestApi { /** * Suggest service. * @module purecloud-platform-client-v2/api/SuggestApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -57595,7 +57624,7 @@ class TaskManagementApi { /** * TaskManagement service. * @module purecloud-platform-client-v2/api/TaskManagementApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -58980,7 +59009,7 @@ class TeamsApi { /** * Teams service. * @module purecloud-platform-client-v2/api/TeamsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -59282,7 +59311,7 @@ class TelephonyApi { /** * Telephony service. * @module purecloud-platform-client-v2/api/TelephonyApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -59464,7 +59493,7 @@ class TelephonyProvidersEdgeApi { /** * TelephonyProvidersEdge service. * @module purecloud-platform-client-v2/api/TelephonyProvidersEdgeApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -62792,7 +62821,7 @@ class TextbotsApi { /** * Textbots service. * @module purecloud-platform-client-v2/api/TextbotsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -62920,7 +62949,7 @@ class TokensApi { /** * Tokens service. * @module purecloud-platform-client-v2/api/TokensApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -63074,7 +63103,7 @@ class UploadsApi { /** * Uploads service. * @module purecloud-platform-client-v2/api/UploadsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -63343,7 +63372,7 @@ class UsageApi { /** * Usage service. * @module purecloud-platform-client-v2/api/UsageApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -63558,7 +63587,7 @@ class UserRecordingsApi { /** * UserRecordings service. * @module purecloud-platform-client-v2/api/UserRecordingsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -63743,7 +63772,7 @@ class UsersApi { /** * Users service. * @module purecloud-platform-client-v2/api/UsersApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -66402,7 +66431,7 @@ class UtilitiesApi { /** * Utilities service. * @module purecloud-platform-client-v2/api/UtilitiesApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -66513,7 +66542,7 @@ class VoicemailApi { /** * Voicemail service. * @module purecloud-platform-client-v2/api/VoicemailApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -67180,7 +67209,7 @@ class WebChatApi { /** * WebChat service. * @module purecloud-platform-client-v2/api/WebChatApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -67731,7 +67760,7 @@ class WebDeploymentsApi { /** * WebDeployments service. * @module purecloud-platform-client-v2/api/WebDeploymentsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -68258,7 +68287,7 @@ class WebMessagingApi { /** * WebMessaging service. * @module purecloud-platform-client-v2/api/WebMessagingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -68304,7 +68333,7 @@ class WidgetsApi { /** * Widgets service. * @module purecloud-platform-client-v2/api/WidgetsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -68450,7 +68479,7 @@ class WorkforceManagementApi { /** * WorkforceManagement service. * @module purecloud-platform-client-v2/api/WorkforceManagementApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -74361,7 +74390,7 @@ class WorkforceManagementApi { * *
* @module purecloud-platform-client-v2/index - * @version 192.0.0 + * @version 192.1.0 */ class platformClient { constructor() { diff --git a/build/dist/web-amd/purecloud-platform-client-v2.js b/build/dist/web-amd/purecloud-platform-client-v2.js index 9cda268e..26e19f44 100644 --- a/build/dist/web-amd/purecloud-platform-client-v2.js +++ b/build/dist/web-amd/purecloud-platform-client-v2.js @@ -399,7 +399,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * @module purecloud-platform-client-v2/ApiClient - * @version 192.0.0 + * @version 192.1.0 */ class ApiClient { /** @@ -1818,7 +1818,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Alerting service. * @module purecloud-platform-client-v2/api/AlertingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -2479,7 +2479,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Analytics service. * @module purecloud-platform-client-v2/api/AnalyticsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -5253,7 +5253,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Architect service. * @module purecloud-platform-client-v2/api/ArchitectApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -9399,7 +9399,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Audit service. * @module purecloud-platform-client-v2/api/AuditApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -9570,7 +9570,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Authorization service. * @module purecloud-platform-client-v2/api/AuthorizationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -10808,7 +10808,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Billing service. * @module purecloud-platform-client-v2/api/BillingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -10888,7 +10888,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * CarrierServices service. * @module purecloud-platform-client-v2/api/CarrierServicesApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -10958,7 +10958,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Chat service. * @module purecloud-platform-client-v2/api/ChatApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -11847,7 +11847,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Coaching service. * @module purecloud-platform-client-v2/api/CoachingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -12424,7 +12424,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * ContentManagement service. * @module purecloud-platform-client-v2/api/ContentManagementApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -13506,7 +13506,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Conversations service. * @module purecloud-platform-client-v2/api/ConversationsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -16495,6 +16495,37 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form ); } + /** + * Update the utilization label on a conversation. When there is no value provided, the system default label is applied + * + * @param {String} conversationId conversation ID + * @param {Object} body Conversation Utilization Label + * patchConversationUtilizationlabel is a preview method and is subject to both breaking and non-breaking changes at any time without notice + */ + patchConversationUtilizationlabel(conversationId, body) { + // verify the required parameter 'conversationId' is set + if (conversationId === undefined || conversationId === null) { + throw 'Missing the required parameter "conversationId" when calling patchConversationUtilizationlabel'; + } + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw 'Missing the required parameter "body" when calling patchConversationUtilizationlabel'; + } + + return this.apiClient.callApi( + '/api/v2/conversations/{conversationId}/utilizationlabel', + 'PATCH', + { 'conversationId': conversationId }, + { }, + { }, + { }, + body, + ['PureCloud OAuth'], + ['application/json'], + ['application/json'] + ); + } + /** * Update after-call work for this conversation communication. * @@ -20717,7 +20748,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * DataExtensions service. * @module purecloud-platform-client-v2/api/DataExtensionsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -20803,7 +20834,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Downloads service. * @module purecloud-platform-client-v2/api/DownloadsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -20855,7 +20886,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Emails service. * @module purecloud-platform-client-v2/api/EmailsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -20920,7 +20951,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Events service. * @module purecloud-platform-client-v2/api/EventsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -21016,7 +21047,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * ExternalContacts service. * @module purecloud-platform-client-v2/api/ExternalContactsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -22974,7 +23005,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Fax service. * @module purecloud-platform-client-v2/api/FaxApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -23189,7 +23220,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Flows service. * @module purecloud-platform-client-v2/api/FlowsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -23373,7 +23404,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Gamification service. * @module purecloud-platform-client-v2/api/GamificationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -25459,7 +25490,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * GeneralDataProtectionRegulation service. * @module purecloud-platform-client-v2/api/GeneralDataProtectionRegulationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -25589,7 +25620,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Geolocation service. * @module purecloud-platform-client-v2/api/GeolocationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -25720,7 +25751,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Greetings service. * @module purecloud-platform-client-v2/api/GreetingsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -26175,7 +26206,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Groups service. * @module purecloud-platform-client-v2/api/GroupsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -26694,7 +26725,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * IdentityProvider service. * @module purecloud-platform-client-v2/api/IdentityProviderApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -27555,7 +27586,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * InfrastructureAsCode service. * @module purecloud-platform-client-v2/api/InfrastructureAsCodeApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -27722,7 +27753,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Integrations service. * @module purecloud-platform-client-v2/api/IntegrationsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -30074,7 +30105,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Journey service. * @module purecloud-platform-client-v2/api/JourneyApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -31428,7 +31459,6 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form * * @param {Object} opts Optional parameters * @param {Object} opts.body - * postJourneyFlowsPathsQuery is a preview method and is subject to both breaking and non-breaking changes at any time without notice */ postJourneyFlowsPathsQuery(opts) { opts = opts || {}; @@ -31664,7 +31694,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Knowledge service. * @module purecloud-platform-client-v2/api/KnowledgeApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -34907,7 +34937,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * LanguageUnderstanding service. * @module purecloud-platform-client-v2/api/LanguageUnderstandingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -35941,7 +35971,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Languages service. * @module purecloud-platform-client-v2/api/LanguagesApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -36163,7 +36193,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Learning service. * @module purecloud-platform-client-v2/api/LearningApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -37018,7 +37048,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * License service. * @module purecloud-platform-client-v2/api/LicenseApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -37256,7 +37286,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Locations service. * @module purecloud-platform-client-v2/api/LocationsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -37492,7 +37522,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * LogCapture service. * @module purecloud-platform-client-v2/api/LogCaptureApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -37692,7 +37722,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Messaging service. * @module purecloud-platform-client-v2/api/MessagingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -38051,7 +38081,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * MobileDevices service. * @module purecloud-platform-client-v2/api/MobileDevicesApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -38202,7 +38232,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Notifications service. * @module purecloud-platform-client-v2/api/NotificationsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -38435,7 +38465,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * OAuth service. * @module purecloud-platform-client-v2/api/OAuthApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -38801,7 +38831,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Objects service. * @module purecloud-platform-client-v2/api/ObjectsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -39071,7 +39101,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * OperationalEvents service. * @module purecloud-platform-client-v2/api/OperationalEventsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -39137,7 +39167,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Organization service. * @module purecloud-platform-client-v2/api/OrganizationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -39592,7 +39622,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * OrganizationAuthorization service. * @module purecloud-platform-client-v2/api/OrganizationAuthorizationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -40939,7 +40969,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Outbound service. * @module purecloud-platform-client-v2/api/OutboundApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -45181,7 +45211,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Presence service. * @module purecloud-platform-client-v2/api/PresenceApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -45925,7 +45955,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * ProcessAutomation service. * @module purecloud-platform-client-v2/api/ProcessAutomationApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -46164,7 +46194,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Quality service. * @module purecloud-platform-client-v2/api/QualityApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -47921,7 +47951,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Recording service. * @module purecloud-platform-client-v2/api/RecordingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -48834,7 +48864,6 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Retrieves an object containing the total number of concurrent active screen recordings * - * getRecordingsScreensessionsDetails is a preview method and is subject to both breaking and non-breaking changes at any time without notice */ getRecordingsScreensessionsDetails() { @@ -49580,7 +49609,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * ResponseManagement service. * @module purecloud-platform-client-v2/api/ResponseManagementApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -50090,7 +50119,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Routing service. * @module purecloud-platform-client-v2/api/RoutingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -54070,7 +54099,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * SCIM service. * @module purecloud-platform-client-v2/api/SCIMApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -54947,7 +54976,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * ScreenRecording service. * @module purecloud-platform-client-v2/api/ScreenRecordingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -54992,7 +55021,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Scripts service. * @module purecloud-platform-client-v2/api/ScriptsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -55436,7 +55465,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Search service. * @module purecloud-platform-client-v2/api/SearchApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -56125,7 +56154,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Settings service. * @module purecloud-platform-client-v2/api/SettingsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -56237,7 +56266,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * SpeechTextAnalytics service. * @module purecloud-platform-client-v2/api/SpeechTextAnalyticsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -57351,7 +57380,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Stations service. * @module purecloud-platform-client-v2/api/StationsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -57453,7 +57482,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Suggest service. * @module purecloud-platform-client-v2/api/SuggestApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -57592,7 +57621,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * TaskManagement service. * @module purecloud-platform-client-v2/api/TaskManagementApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -58977,7 +59006,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Teams service. * @module purecloud-platform-client-v2/api/TeamsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -59279,7 +59308,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Telephony service. * @module purecloud-platform-client-v2/api/TelephonyApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -59461,7 +59490,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * TelephonyProvidersEdge service. * @module purecloud-platform-client-v2/api/TelephonyProvidersEdgeApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -62789,7 +62818,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Textbots service. * @module purecloud-platform-client-v2/api/TextbotsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -62917,7 +62946,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Tokens service. * @module purecloud-platform-client-v2/api/TokensApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -63071,7 +63100,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Uploads service. * @module purecloud-platform-client-v2/api/UploadsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -63340,7 +63369,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Usage service. * @module purecloud-platform-client-v2/api/UsageApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -63555,7 +63584,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * UserRecordings service. * @module purecloud-platform-client-v2/api/UserRecordingsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -63740,7 +63769,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Users service. * @module purecloud-platform-client-v2/api/UsersApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -66399,7 +66428,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Utilities service. * @module purecloud-platform-client-v2/api/UtilitiesApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -66510,7 +66539,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Voicemail service. * @module purecloud-platform-client-v2/api/VoicemailApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -67177,7 +67206,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * WebChat service. * @module purecloud-platform-client-v2/api/WebChatApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -67728,7 +67757,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * WebDeployments service. * @module purecloud-platform-client-v2/api/WebDeploymentsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -68255,7 +68284,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * WebMessaging service. * @module purecloud-platform-client-v2/api/WebMessagingApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -68301,7 +68330,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * Widgets service. * @module purecloud-platform-client-v2/api/WidgetsApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -68447,7 +68476,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * WorkforceManagement service. * @module purecloud-platform-client-v2/api/WorkforceManagementApi - * @version 192.0.0 + * @version 192.1.0 */ /** @@ -74358,7 +74387,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form * * * @module purecloud-platform-client-v2/index - * @version 192.0.0 + * @version 192.1.0 */ class platformClient { constructor() { diff --git a/build/dist/web-amd/purecloud-platform-client-v2.min.js b/build/dist/web-amd/purecloud-platform-client-v2.min.js index 5519a79d..55a52b37 100644 --- a/build/dist/web-amd/purecloud-platform-client-v2.min.js +++ b/build/dist/web-amd/purecloud-platform-client-v2.min.js @@ -1 +1 @@ -define(["axios","qs"],function(e,i){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e),a=t(i),o={us_east_1:"mypurecloud.com",eu_west_1:"mypurecloud.ie",ap_southeast_2:"mypurecloud.com.au",ap_northeast_1:"mypurecloud.jp",eu_central_1:"mypurecloud.de",us_west_2:"usw2.pure.cloud",ca_central_1:"cac1.pure.cloud",ap_northeast_2:"apne2.pure.cloud",eu_west_2:"euw2.pure.cloud",ap_south_1:"aps1.pure.cloud",us_east_2:"use2.us-gov-pure.cloud",sa_east_1:"sae1.pure.cloud"};const r={levels:{none:0,error:1,debug:2,trace:3}},l={level:{LNone:"none",LError:"error",LDebug:"debug",LTrace:"trace"}},s={formats:{JSON:"json",TEXT:"text"}};class p{get logLevelEnum(){return l}get logFormatEnum(){return s}constructor(){this.log_level=l.level.LNone,this.log_format=s.formats.TEXT,this.log_to_console=!0,this.log_file_path,this.log_response_body=!1,this.log_request_body=!1,this.setLogger()}setLogger(){if("undefined"==typeof window){const e=require("winston");this.logger=e.createLogger({levels:r.levels,level:this.log_level}),this.log_file_path&&""!==this.log_file_path&&(this.log_format===s.formats.JSON?this.logger.add(new e.transports.File({format:e.format.json(),filename:this.log_file_path})):this.logger.add(new e.transports.File({format:e.format.combine(e.format(e=>(e.level=e.level.toUpperCase(),e))(),e.format.simple()),filename:this.log_file_path}))),this.log_to_console&&(this.log_format===s.formats.JSON?this.logger.add(new e.transports.Console({format:e.format.json()})):this.logger.add(new e.transports.Console({format:e.format.combine(e.format(e=>(e.level=e.level.toUpperCase(),e))(),e.format.simple())})))}}log(e,i,t,n,a,o,r,l){var s=this.formatLog(e,i,t,n,a,o,r,l);"undefined"!=typeof window?this.calculateLogLevel(e)>0&&!0===this.log_to_console&&(this.log_format===this.logFormatEnum.formats.JSON?console.log(s):console.log(`${e.toUpperCase()}: ${s}`)):this.logger.transports.length>0&&this.logger.log(e,s)}calculateLogLevel(e){switch(this.log_level){case this.logLevelEnum.level.LError:return e!==this.logLevelEnum.level.LError?-1:1;case this.logLevelEnum.level.LDebug:return e===this.logLevelEnum.level.LTrace?-1:1;case this.logLevelEnum.level.LTrace:return 1;default:return-1}}formatLog(e,i,t,n,a,o,r,l){var p,u=a?JSON.parse(JSON.stringify(a)):null,d=o?JSON.parse(JSON.stringify(o)):null,c=r?JSON.parse(JSON.stringify(r)):null,g=l?JSON.parse(JSON.stringify(l)):null;return a&&(u.Authorization="[REDACTED]"),this.log_request_body||(c=void 0),this.log_response_body||(g=void 0),this.log_format&&this.log_format===s.formats.JSON?(p={level:e,date:(new Date).toISOString(),method:t,url:decodeURIComponent(n),correlationId:d&&d["inin-correlation-id"]?d["inin-correlation-id"]:"",statusCode:i},u&&(p.requestHeaders=u),d&&(p.responseHeaders=d),c&&(p.requestBody=c),g&&(p.responseBody=g)):p=`${(new Date).toISOString()}\n=== REQUEST === \n${this.formatValue("URL",decodeURIComponent(n))}${this.formatValue("Method",t)}${this.formatValue("Headers",this.formatHeaderString(u))}${this.formatValue("Body",c?JSON.stringify(c,null,2):"")}\n=== RESPONSE ===\n${this.formatValue("Status",i)}${this.formatValue("Headers",this.formatHeaderString(d))}${this.formatValue("CorrelationId",d&&d["inin-correlation-id"]?d["inin-correlation-id"]:"")}${this.formatValue("Body",g?JSON.stringify(g,null,2):"")}`,p}formatHeaderString(e){var i="";if(!e)return i;for(const[t,n]of Object.entries(e))i+=`\n\t${t}: ${n}`;return i}formatValue(e,i){return i&&""!==i&&"{}"!==i?`${e}: ${i}\n`:""}getLogLevel(e){switch(e){case"error":return l.level.LError;case"debug":return l.level.LDebug;case"trace":return l.level.LTrace;default:return l.level.LNone}}getLogFormat(e){switch(e){case"json":return s.formats.JSON;default:return s.formats.TEXT}}}class u{get instance(){return u.instance}set instance(e){u.instance=e}constructor(){if(u.instance||(u.instance=this),"undefined"!=typeof window)this.configPath="";else{const e=require("os"),i=require("path");this.configPath=i.join(e.homedir(),".genesyscloudjavascript","config")}this.refresh_access_token=!0,this.refresh_token_wait_max=10,this.live_reload_config=!0,this.host,this.environment,this.basePath,this.authUrl,this.config,this.logger=new p,this.setEnvironment(),this.liveLoadConfig()}liveLoadConfig(){if("undefined"!=typeof window)this.configPath="";else if(this.updateConfigFromFile(),this.live_reload_config&&!0===this.live_reload_config)try{const e=require("fs");e.watchFile(this.configPath,{persistent:!1},(i,t)=>{this.updateConfigFromFile(),this.live_reload_config||e.unwatchFile(this.configPath)})}catch(e){}}setConfigPath(e){e&&e!==this.configPath&&(this.configPath=e,this.liveLoadConfig())}updateConfigFromFile(){if("undefined"==typeof window){const t=require("configparser");try{var e=new t;e.read(this.configPath),this.config=e}catch(e){if(e.name&&"MissingSectionHeaderError"===e.name){var i=require("fs").readFileSync(this.configPath,"utf8");this.config={_sections:JSON.parse(i)}}}this.config&&this.updateConfigValues()}}updateConfigValues(){this.logger.log_level=this.logger.getLogLevel(this.getConfigString("logging","log_level")),this.logger.log_format=this.logger.getLogFormat(this.getConfigString("logging","log_format")),this.logger.log_to_console=void 0!==this.getConfigBoolean("logging","log_to_console")?this.getConfigBoolean("logging","log_to_console"):this.logger.log_to_console,this.logger.log_file_path=void 0!==this.getConfigString("logging","log_file_path")?this.getConfigString("logging","log_file_path"):this.logger.log_file_path,this.logger.log_response_body=void 0!==this.getConfigBoolean("logging","log_response_body")?this.getConfigBoolean("logging","log_response_body"):this.logger.log_response_body,this.logger.log_request_body=void 0!==this.getConfigBoolean("logging","log_request_body")?this.getConfigBoolean("logging","log_request_body"):this.logger.log_request_body,this.refresh_access_token=void 0!==this.getConfigBoolean("reauthentication","refresh_access_token")?this.getConfigBoolean("reauthentication","refresh_access_token"):this.refresh_access_token,this.refresh_token_wait_max=void 0!==this.getConfigInt("reauthentication","refresh_token_wait_max")?this.getConfigInt("reauthentication","refresh_token_wait_max"):this.refresh_token_wait_max,this.live_reload_config=void 0!==this.getConfigBoolean("general","live_reload_config")?this.getConfigBoolean("general","live_reload_config"):this.live_reload_config,this.host=void 0!==this.getConfigString("general","host")?this.getConfigString("general","host"):this.host,this.setEnvironment(),this.logger.setLogger()}setEnvironment(e){this.environment=e||(this.host?this.host:"mypurecloud.com"),this.environment=this.environment.replace(/\/+$/,""),this.environment.startsWith("https://")&&(this.environment=this.environment.substring(8)),this.environment.startsWith("http://")&&(this.environment=this.environment.substring(7)),this.environment.startsWith("api.")&&(this.environment=this.environment.substring(4)),this.basePath=`https://api.${this.environment}`,this.authUrl=`https://login.${this.environment}`}getConfigString(e,i){if(this.config._sections[e])return this.config._sections[e][i]}getConfigBoolean(e,i){if(this.config._sections[e]&&void 0!==this.config._sections[e][i])return"string"==typeof this.config._sections[e][i]?"true"===this.config._sections[e][i]:this.config._sections[e][i]}getConfigInt(e,i){if(this.config._sections[e]&&this.config._sections[e][i])return"string"==typeof this.config._sections[e][i]?parseInt(this.config._sections[e][i]):this.config._sections[e][i]}}class d{get instance(){return d.instance}set instance(e){d.instance=e}constructor(){d.instance||(d.instance=this),this.CollectionFormatEnum={CSV:",",SSV:" ",TSV:"\t",PIPES:"|",MULTI:"multi"};try{localStorage.setItem("purecloud_local_storage_test","purecloud_local_storage_test"),localStorage.removeItem("purecloud_local_storage_test"),this.hasLocalStorage=!0}catch(e){this.hasLocalStorage=!1}this.authentications={"Guest Chat JWT":{type:"apiKey",in:"header",name:"Authorization"},"PureCloud OAuth":{type:"oauth2"}},this.defaultHeaders={},this.timeout=16e3,this.authData={},this.settingsPrefix="purecloud",this.refreshInProgress=!1,this.config=new u,"undefined"!=typeof window&&(window.ApiClient=this)}setReturnExtendedResponses(e){this.returnExtended=e}setPersistSettings(e,i){this.persistSettings=e,this.settingsPrefix=i?i.replace(/\W+/g,"_"):"purecloud"}_saveSettings(e){try{if(this.authData.accessToken=e.accessToken,this.authentications["PureCloud OAuth"].accessToken=e.accessToken,e.state&&(this.authData.state=e.state),this.authData.error=e.error,this.authData.error_description=e.error_description,e.tokenExpiryTime&&(this.authData.tokenExpiryTime=e.tokenExpiryTime,this.authData.tokenExpiryTimeString=e.tokenExpiryTimeString),!0!==this.persistSettings)return;if(!this.hasLocalStorage)return;let i=JSON.parse(JSON.stringify(this.authData));delete i.state,localStorage.setItem(`${this.settingsPrefix}_auth_data`,JSON.stringify(i))}catch(e){console.error(e)}}_loadSettings(){if(!0!==this.persistSettings)return;if(!this.hasLocalStorage)return;const e=this.authData.state;this.authData=localStorage.getItem(`${this.settingsPrefix}_auth_data`),this.authData?this.authData=JSON.parse(this.authData):this.authData={},this.authData.accessToken&&this.setAccessToken(this.authData.accessToken),this.authData.state=e}setEnvironment(e){this.config.setEnvironment(e)}loginImplicitGrant(e,i,t){const n=this._setValuesFromUrlHash();return this.clientId=e,this.redirectUri=i,t||(t={}),new Promise((e,i)=>{if(t.org&&!t.provider?i(new Error("opts.provider must be set if opts.org is set")):t.provider&&!t.org&&i(new Error("opts.org must be set if opts.provider is set")),n&&n.error)return n.accessToken=void 0,this._saveSettings(n),i(new Error(`[${n.error}] ${n.error_description}`));this._testTokenAccess().then(()=>{!this.authData.state&&t.state&&(this.authData.state=t.state),e(this.authData)}).catch(e=>{var i={client_id:encodeURIComponent(this.clientId),redirect_uri:encodeURIComponent(this.redirectUri),response_type:"token"};t.state&&(i.state=encodeURIComponent(t.state)),t.org&&(i.org=encodeURIComponent(t.org)),t.provider&&(i.provider=encodeURIComponent(t.provider));var n=this._buildAuthUrl("oauth/authorize",i);window.location.replace(n)})})}loginClientCredentialsGrant(e,i){this.clientId=e;var t=Buffer.from(`${e}:${i}`).toString("base64");return new Promise((e,i)=>{if("undefined"!=typeof window)return void i(new Error("The client credentials grant is not supported in a browser."));const a={Authorization:`Basic ${t}`};n.default({method:"POST",url:`https://login.${this.config.environment}/oauth/token`,headers:a,data:"grant_type=client_credentials",httpsAgent:this.proxyAgent}).then(i=>{this.config.logger.log("trace",i.status,"POST",`https://login.${this.config.environment}/oauth/token`,a,i.headers,{grant_type:"client_credentials"},void 0),this.config.logger.log("debug",i.status,"POST",`https://login.${this.config.environment}/oauth/token`,a,void 0,{grant_type:"client_credentials"},void 0),this.setAccessToken(i.data.access_token),this.authData.tokenExpiryTime=(new Date).getTime()+1e3*i.data.expires_in,this.authData.tokenExpiryTimeString=new Date(this.authData.tokenExpiryTime).toUTCString(),e(this.authData)}).catch(e=>{e.response&&this.config.logger.log("error",e.response.status,"POST",`https://login.${this.config.environment}/oauth/token`,a,e.response.headers,{grant_type:"client_credentials"},e.response.data),i(e)})})}loginSaml2BearerGrant(e,i,t,n){return this.clientId=e,new Promise((a,o)=>{if("undefined"==typeof window){var r=Buffer.from(e+":"+i).toString("base64"),l=this._formAuthRequest(r,{grant_type:"urn:ietf:params:oauth:grant-type:saml2-bearer",orgName:t,assertion:n});l.proxy=this.proxy;var s={grant_type:"urn:ietf:params:oauth:grant-type:saml2-bearer",orgName:t,assertion:n};l.then(e=>{this.config.logger.log("trace",e.status,"POST",`https://login.${this.config.environment}/oauth/token`,l.headers,e.headers,s,void 0),this.config.logger.log("debug",e.status,"POST",`https://login.${this.config.environment}/oauth/token`,l.headers,void 0,s,void 0);var i=e.data.access_token;this.setAccessToken(i),this.authData.tokenExpiryTime=(new Date).getTime()+1e3*e.data.expires_in,this.authData.tokenExpiryTimeString=new Date(this.authData.tokenExpiryTime).toUTCString(),a(this.authData)}).catch(e=>{e.response&&this.config.logger.log("error",e.response.status,"POST",`https://login.${this.config.environment}/oauth/token`,l.headers,e.response.headers,s,e.response.data),o(e)})}else o(new Error("The saml2bearer grant is not supported in a browser."))})}authorizePKCEGrant(e,i,t,o){return this.clientId=e,new Promise((r,l)=>{var s=n.default({method:"POST",url:`https://login.${this.config.environment}/oauth/token`,headers:{"Content-Type":"application/x-www-form-urlencoded"},data:a.default.stringify({grant_type:"authorization_code",code:t,code_verifier:i,client_id:e,redirect_uri:o})});s.proxy=this.proxy;var p={grant_type:"authorization_code",code:t,code_verifier:i,client_id:e,redirect_uri:o};s.then(e=>{this.config.logger.log("trace",e.status,"POST",`https://login.${this.config.environment}/oauth/token`,s.headers,e.headers,p,void 0),this.config.logger.log("debug",e.status,"POST",`https://login.${this.config.environment}/oauth/token`,s.headers,void 0,p,void 0);var i=e.data.access_token;this.setAccessToken(i),this.authData.tokenExpiryTime=(new Date).getTime()+1e3*e.data.expires_in,this.authData.tokenExpiryTimeString=new Date(this.authData.tokenExpiryTime).toUTCString(),r(this.authData)}).catch(e=>{e.response&&this.config.logger.log("error",e.response.status,"POST",`https://login.${this.config.environment}/oauth/token`,s.headers,e.response.headers,p,e.response.data),l(e)})})}generatePKCECodeVerifier(e){if(e<43||e>128)throw new Error("PKCE Code Verifier (length) must be between 43 and 128 characters");if("undefined"!=typeof window){const i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~";return Array.from(crypto.getRandomValues(new Uint32Array(e))).map(e=>i[e%i.length]).join("")}try{const i=require("crypto").getRandomValues,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~";return Array.from(i(new Uint32Array(e))).map(e=>t[e%t.length]).join("")}catch(e){throw new Error("Crypto module is missing/not supported.")}}computePKCECodeChallenge(e){if(e.length<43||e.length>128)throw new Error("PKCE Code Verifier (length) must be between 43 and 128 characters");if("undefined"!=typeof window){const i=(new TextEncoder).encode(e);return new Promise((e,t)=>{window.crypto.subtle.digest("SHA-256",i).then(i=>{let t=Buffer.from(i).toString("base64").replaceAll("+","-").replaceAll("/","_");t=t.split("=")[0],e(t)}).catch(e=>t(new Error(`Code Challenge Error ${e}`)))})}try{const i=require("crypto").createHash,t=(new TextEncoder).encode(e);return new Promise((e,n)=>{const a=i("sha256").update(t).digest();e(Buffer.from(a).toString("base64url"))})}catch(e){throw new Error("Crypto module is missing/not supported.")}}loginPKCEGrant(e,i,t,n){if(!this.hasLocalStorage&&!n)throw new Error("loginPKCEGrant requires Local Storage or codeVerifier as input parameter");const a=this._setValuesFromUrlQuery();return this.clientId=e,this.redirectUri=i,this.codeVerifier=n,t||(t={}),new Promise((e,i)=>{if(t.org&&!t.provider?i(new Error("opts.provider must be set if opts.org is set")):t.provider&&!t.org&&i(new Error("opts.org must be set if opts.provider is set")),a&&a.error)return this.hasLocalStorage&&sessionStorage.removeItem("genesys_cloud_sdk_pkce_code_verifier"),this._saveSettings({accessToken:void 0}),i(new Error(`[${a.error}] ${a.error_description}`));a&&a.code?(this.codeVerifier||this.hasLocalStorage&&(this.codeVerifier=sessionStorage.getItem("genesys_cloud_sdk_pkce_code_verifier")),this.authorizePKCEGrant(this.clientId,this.codeVerifier,a.code,this.redirectUri).then(()=>{this._testTokenAccess().then(()=>{!this.authData.state&&a.state&&(this.authData.state=a.state),this.hasLocalStorage&&sessionStorage.removeItem("genesys_cloud_sdk_pkce_code_verifier"),e(this.authData)}).catch(e=>(this._saveSettings({accessToken:void 0}),this.hasLocalStorage&&sessionStorage.removeItem("genesys_cloud_sdk_pkce_code_verifier"),i(new Error(`[${e.name}] ${e.msg}`))))}).catch(e=>(this._saveSettings({accessToken:void 0}),this.hasLocalStorage&&sessionStorage.removeItem("genesys_cloud_sdk_pkce_code_verifier"),i(new Error(`[${e.name}] ${e.msg}`))))):this._testTokenAccess().then(()=>{!this.authData.state&&t.state&&(this.authData.state=t.state),e(this.authData)}).catch(e=>{this.codeVerifier||(this.codeVerifier=this.generatePKCECodeVerifier(128),this.hasLocalStorage&&sessionStorage.setItem("genesys_cloud_sdk_pkce_code_verifier",this.codeVerifier)),this.computePKCECodeChallenge(this.codeVerifier).then(e=>{var i={client_id:encodeURIComponent(this.clientId),redirect_uri:encodeURIComponent(this.redirectUri),code_challenge:encodeURIComponent(e),response_type:"code",code_challenge_method:"S256"};t.state&&(i.state=encodeURIComponent(t.state)),t.org&&(i.org=encodeURIComponent(t.org)),t.provider&&(i.provider=encodeURIComponent(t.provider));var n=this._buildAuthUrl("oauth/authorize",i);window.location.replace(n)}).catch(e=>i(new Error(`[${e.name}]`)))})})}_setValuesFromUrlQuery(){if("undefined"==typeof window||!window.location.search)return;let e={},i=new URLSearchParams(window.location.search),t=i.get("code"),n=i.get("error"),a=i.get("error_description"),o=i.get("state");if(n)return e.error=n,a&&(e.error_description=a),e;t&&(e.code=t,o&&(e.state=o));var r,l,s=window.location;return"replaceState"in history?history.replaceState("",document.title,s.pathname):(r=document.body.scrollTop,l=document.body.scrollLeft,history.pushState("",document.title,s.pathname),document.body.scrollTop=r,document.body.scrollLeft=l),e}loginCodeAuthorizationGrant(e,i,t,n){return this.clientId=e,this.clientSecret=i,new Promise((a,o)=>{if("undefined"==typeof window){var r=Buffer.from(e+":"+i).toString("base64"),l=this._formAuthRequest(r,{grant_type:"authorization_code",code:t,redirect_uri:n});l.proxy=this.proxy;var s={grant_type:"authorization_code",code:t,redirect_uri:n};this._handleCodeAuthorizationResponse(l,s,a,o)}else o(new Error("The Code Authorization grant is not supported in a browser."))})}refreshCodeAuthorizationGrant(e,i,t){return new Promise((n,a)=>{if("undefined"==typeof window){var o=Buffer.from(e+":"+i).toString("base64"),r=this._formAuthRequest(o,{grant_type:"refresh_token",refresh_token:t});r.proxy=this.proxy;var l={grant_type:"refresh_token",refresh_token:t};this._handleCodeAuthorizationResponse(r,l,n,a)}else a(new Error("The Code Authorization grant is not supported in a browser."))})}_handleCodeAuthorizationResponse(e,i,t,n){e.then(n=>{this.config.logger.log("trace",n.status,"POST",`https://login.${this.config.environment}/oauth/token`,e.headers,n.headers,i,void 0),this.config.logger.log("debug",n.status,"POST",`https://login.${this.config.environment}/oauth/token`,e.headers,void 0,i,void 0);var a=n.data.access_token,o=n.data.refresh_token;this.setAccessToken(a),this.authData.refreshToken=o,this.authData.tokenExpiryTime=(new Date).getTime()+1e3*n.data.expires_in,this.authData.tokenExpiryTimeString=new Date(this.authData.tokenExpiryTime).toUTCString(),t(this.authData)}).catch(t=>{t.response&&this.config.logger.log("error",t.response.status,"POST",`https://login.${this.config.environment}/oauth/token`,e.headers,t.response.headers,i,t.response.data),n(t)})}_formAuthRequest(e,i){return n.default({method:"POST",url:`https://login.${this.config.environment}/oauth/token`,headers:{Authorization:"Basic "+e,"Content-Type":"application/x-www-form-urlencoded"},data:a.default.stringify(i)})}_handleExpiredAccessToken(){return new Promise((e,i)=>{"undefined"==typeof window?this.refreshInProgress?this._sleep(this.config.refresh_token_wait_max).then(()=>{this.refreshInProgress?i(new Error(`Token refresh took longer than ${this.config.refresh_token_wait_max} seconds`)):e()}):(this.refreshInProgress=!0,this.refreshCodeAuthorizationGrant(this.clientId,this.clientSecret,this.authData.refreshToken).then(()=>{this.refreshInProgress=!1,e()}).catch(e=>{this.refreshInProgress=!1,i(e)})):i(new Error("This method is not supported in a browser."))})}_sleep(e){return new Promise(i=>setTimeout(i,e))}_testTokenAccess(){return new Promise((e,i)=>{this._loadSettings(),this.authentications["PureCloud OAuth"].accessToken?this.callApi("/api/v2/tokens/me","GET",null,null,null,null,null,["PureCloud OAuth"],["application/json"],["application/json"]).then(()=>{e()}).catch(e=>{this._saveSettings({accessToken:void 0}),i(e)}):i(new Error("Token is not set"))})}_setValuesFromUrlHash(){if("undefined"==typeof window||!window.location.hash)return;const e=new RegExp("^#*(.+?)=(.+?)$","i");let i={};if(window.location.hash.split("&").forEach(t=>{const n=e.exec(t);n&&(i[n[1]]=decodeURIComponent(decodeURIComponent(n[2].replace(/\+/g,"%20"))))}),i.error)return i;if(i.access_token){let e={};i.state&&(e.state=i.state),i.expires_in&&(e.tokenExpiryTime=(new Date).getTime()+1e3*parseInt(i.expires_in.replace(/\+/g,"%20")),e.tokenExpiryTimeString=new Date(e.tokenExpiryTime).toUTCString()),e.accessToken=i.access_token.replace(/\+/g,"%20");var t,n,a=window.location;"replaceState"in history?history.replaceState("",document.title,a.pathname+a.search):(t=document.body.scrollTop,n=document.body.scrollLeft,a.hash="",document.body.scrollTop=t,document.body.scrollLeft=n),this._saveSettings(e)}}setAccessToken(e){this._saveSettings({accessToken:e})}setStorageKey(e){this.storageKey=e,this.setAccessToken(this.authentications["PureCloud OAuth"].accessToken)}logout(e){this.hasLocalStorage&&this._saveSettings({accessToken:void 0,state:void 0,tokenExpiryTime:void 0,tokenExpiryTimeString:void 0});var i={client_id:encodeURIComponent(this.clientId)};e&&(i.redirect_uri=encodeURI(e));var t=this._buildAuthUrl("logout",i);window.location.replace(t)}_buildAuthUrl(e,i){return i||(i={}),Object.keys(i).reduce((e,t)=>i[t]?`${e}&${t}=${i[t]}`:e,`${this.config.authUrl}/${e}?`)}paramToString(e){return e?e instanceof Date?e.toJSON():e.toString():""}serialize(e){var i={};for(var t in e)e.hasOwnProperty(t)&&void 0!==e[t]&&(i[encodeURIComponent(t)]=Array.isArray(e[t])?e[t].join(","):this.paramToString(e[t]));return i}addHeaders(e,...i){return e=e?Object.assign(e,...i):Object.assign(...i)}buildUrl(e,i){e.match(/^\//)||(e=`/${e}`);var t=this.config.basePath+e;return t=t.replace(/\{([\w-]+)\}/g,(e,t)=>{var n;return n=i.hasOwnProperty(t)?this.paramToString(i[t]):e,encodeURIComponent(n)})}isJsonMime(e){return Boolean(e&&e.match(/^application\/json(;.*)?$/i))}jsonPreferredMime(e){for(var i=0;i