@wildix/wda-insights-client 1.0.1

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 (52) hide show
  1. package/dist-cjs/WdaInsights.js +17 -0
  2. package/dist-cjs/WdaInsightsClient.js +33 -0
  3. package/dist-cjs/commands/GetCallSummaryCommand.js +41 -0
  4. package/dist-cjs/commands/GetConferenceSummaryCommand.js +41 -0
  5. package/dist-cjs/commands/ListConversationsCommand.js +41 -0
  6. package/dist-cjs/commands/index.js +6 -0
  7. package/dist-cjs/extensionConfiguration.js +2 -0
  8. package/dist-cjs/index.js +10 -0
  9. package/dist-cjs/models/WdaInsightsServiceException.js +12 -0
  10. package/dist-cjs/models/index.js +4 -0
  11. package/dist-cjs/models/models_0.js +137 -0
  12. package/dist-cjs/protocols/Aws_restJson1.js +297 -0
  13. package/dist-cjs/runtimeConfig.browser.js +28 -0
  14. package/dist-cjs/runtimeConfig.js +32 -0
  15. package/dist-cjs/runtimeConfig.native.js +15 -0
  16. package/dist-cjs/runtimeConfig.shared.js +19 -0
  17. package/dist-cjs/runtimeExtensions.js +19 -0
  18. package/dist-es/WdaInsights.js +13 -0
  19. package/dist-es/WdaInsightsClient.js +29 -0
  20. package/dist-es/commands/GetCallSummaryCommand.js +37 -0
  21. package/dist-es/commands/GetConferenceSummaryCommand.js +37 -0
  22. package/dist-es/commands/ListConversationsCommand.js +37 -0
  23. package/dist-es/commands/index.js +3 -0
  24. package/dist-es/extensionConfiguration.js +1 -0
  25. package/dist-es/index.js +5 -0
  26. package/dist-es/models/WdaInsightsServiceException.js +8 -0
  27. package/dist-es/models/index.js +1 -0
  28. package/dist-es/models/models_0.js +130 -0
  29. package/dist-es/protocols/Aws_restJson1.js +288 -0
  30. package/dist-es/runtimeConfig.browser.js +24 -0
  31. package/dist-es/runtimeConfig.js +28 -0
  32. package/dist-es/runtimeConfig.native.js +11 -0
  33. package/dist-es/runtimeConfig.shared.js +15 -0
  34. package/dist-es/runtimeExtensions.js +15 -0
  35. package/dist-types/WdaInsights.d.ts +30 -0
  36. package/dist-types/WdaInsightsClient.d.ts +139 -0
  37. package/dist-types/commands/GetCallSummaryCommand.d.ts +84 -0
  38. package/dist-types/commands/GetConferenceSummaryCommand.d.ts +83 -0
  39. package/dist-types/commands/ListConversationsCommand.d.ts +213 -0
  40. package/dist-types/commands/index.d.ts +3 -0
  41. package/dist-types/extensionConfiguration.d.ts +7 -0
  42. package/dist-types/index.d.ts +5 -0
  43. package/dist-types/models/WdaInsightsServiceException.d.ts +13 -0
  44. package/dist-types/models/index.d.ts +1 -0
  45. package/dist-types/models/models_0.d.ts +452 -0
  46. package/dist-types/protocols/Aws_restJson1.d.ts +29 -0
  47. package/dist-types/runtimeConfig.browser.d.ts +29 -0
  48. package/dist-types/runtimeConfig.d.ts +29 -0
  49. package/dist-types/runtimeConfig.native.d.ts +28 -0
  50. package/dist-types/runtimeConfig.shared.d.ts +15 -0
  51. package/dist-types/runtimeExtensions.d.ts +17 -0
  52. package/package.json +77 -0
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WdaInsights = void 0;
4
+ const WdaInsightsClient_1 = require("./WdaInsightsClient");
5
+ const GetCallSummaryCommand_1 = require("./commands/GetCallSummaryCommand");
6
+ const GetConferenceSummaryCommand_1 = require("./commands/GetConferenceSummaryCommand");
7
+ const ListConversationsCommand_1 = require("./commands/ListConversationsCommand");
8
+ const smithy_client_1 = require("@smithy/smithy-client");
9
+ const commands = {
10
+ GetCallSummaryCommand: GetCallSummaryCommand_1.GetCallSummaryCommand,
11
+ GetConferenceSummaryCommand: GetConferenceSummaryCommand_1.GetConferenceSummaryCommand,
12
+ ListConversationsCommand: ListConversationsCommand_1.ListConversationsCommand,
13
+ };
14
+ class WdaInsights extends WdaInsightsClient_1.WdaInsightsClient {
15
+ }
16
+ exports.WdaInsights = WdaInsights;
17
+ (0, smithy_client_1.createAggregatedClient)(commands, WdaInsights);
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WdaInsightsClient = exports.__Client = void 0;
4
+ const runtimeConfig_1 = require("./runtimeConfig");
5
+ const runtimeExtensions_1 = require("./runtimeExtensions");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "__Client", { enumerable: true, get: function () { return smithy_client_1.Client; } });
8
+ const smithy_utils_1 = require("@wildix/smithy-utils");
9
+ class WdaInsightsClient extends smithy_client_1.Client {
10
+ constructor(...[configuration]) {
11
+ let _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});
12
+ let _config_1 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_0, configuration?.extensions || []);
13
+ const endpoint = () => {
14
+ return {
15
+ hostname: configuration.env === 'prod' || !configuration.env ? 'wda.wildix.com' : configuration.env === 'stable' ? 'wda-stable.wildix.com' : 'wda-stage.wildix.com',
16
+ protocol: "https",
17
+ port: '443',
18
+ path: ''
19
+ };
20
+ };
21
+ const config = {
22
+ ..._config_1,
23
+ endpoint,
24
+ };
25
+ super(config);
26
+ this.config = config;
27
+ this.middlewareStack.add(smithy_utils_1.authorizationMiddleware.bind(this, configuration.token), { step: "build" });
28
+ }
29
+ destroy() {
30
+ super.destroy();
31
+ }
32
+ }
33
+ exports.WdaInsightsClient = WdaInsightsClient;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetCallSummaryCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ class GetCallSummaryCommand extends smithy_client_1.Command {
10
+ constructor(input) {
11
+ super();
12
+ this.input = input;
13
+ }
14
+ resolveMiddleware(clientStack, configuration, options) {
15
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
16
+ const stack = clientStack.concat(this.middlewareStack);
17
+ const { logger } = configuration;
18
+ const clientName = "WdaInsightsClient";
19
+ const commandName = "GetCallSummaryCommand";
20
+ const handlerExecutionContext = {
21
+ logger,
22
+ clientName,
23
+ commandName,
24
+ inputFilterSensitiveLog: (_) => _,
25
+ outputFilterSensitiveLog: (_) => _,
26
+ [types_1.SMITHY_CONTEXT_KEY]: {
27
+ service: "WdaInsights",
28
+ operation: "GetCallSummary",
29
+ },
30
+ };
31
+ const { requestHandler } = configuration;
32
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
33
+ }
34
+ serialize(input, context) {
35
+ return (0, Aws_restJson1_1.se_GetCallSummaryCommand)(input, context);
36
+ }
37
+ deserialize(output, context) {
38
+ return (0, Aws_restJson1_1.de_GetCallSummaryCommand)(output, context);
39
+ }
40
+ }
41
+ exports.GetCallSummaryCommand = GetCallSummaryCommand;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetConferenceSummaryCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ class GetConferenceSummaryCommand extends smithy_client_1.Command {
10
+ constructor(input) {
11
+ super();
12
+ this.input = input;
13
+ }
14
+ resolveMiddleware(clientStack, configuration, options) {
15
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
16
+ const stack = clientStack.concat(this.middlewareStack);
17
+ const { logger } = configuration;
18
+ const clientName = "WdaInsightsClient";
19
+ const commandName = "GetConferenceSummaryCommand";
20
+ const handlerExecutionContext = {
21
+ logger,
22
+ clientName,
23
+ commandName,
24
+ inputFilterSensitiveLog: (_) => _,
25
+ outputFilterSensitiveLog: (_) => _,
26
+ [types_1.SMITHY_CONTEXT_KEY]: {
27
+ service: "WdaInsights",
28
+ operation: "GetConferenceSummary",
29
+ },
30
+ };
31
+ const { requestHandler } = configuration;
32
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
33
+ }
34
+ serialize(input, context) {
35
+ return (0, Aws_restJson1_1.se_GetConferenceSummaryCommand)(input, context);
36
+ }
37
+ deserialize(output, context) {
38
+ return (0, Aws_restJson1_1.de_GetConferenceSummaryCommand)(output, context);
39
+ }
40
+ }
41
+ exports.GetConferenceSummaryCommand = GetConferenceSummaryCommand;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListConversationsCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ class ListConversationsCommand extends smithy_client_1.Command {
10
+ constructor(input) {
11
+ super();
12
+ this.input = input;
13
+ }
14
+ resolveMiddleware(clientStack, configuration, options) {
15
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
16
+ const stack = clientStack.concat(this.middlewareStack);
17
+ const { logger } = configuration;
18
+ const clientName = "WdaInsightsClient";
19
+ const commandName = "ListConversationsCommand";
20
+ const handlerExecutionContext = {
21
+ logger,
22
+ clientName,
23
+ commandName,
24
+ inputFilterSensitiveLog: (_) => _,
25
+ outputFilterSensitiveLog: (_) => _,
26
+ [types_1.SMITHY_CONTEXT_KEY]: {
27
+ service: "WdaInsights",
28
+ operation: "ListConversations",
29
+ },
30
+ };
31
+ const { requestHandler } = configuration;
32
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
33
+ }
34
+ serialize(input, context) {
35
+ return (0, Aws_restJson1_1.se_ListConversationsCommand)(input, context);
36
+ }
37
+ deserialize(output, context) {
38
+ return (0, Aws_restJson1_1.de_ListConversationsCommand)(output, context);
39
+ }
40
+ }
41
+ exports.ListConversationsCommand = ListConversationsCommand;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./GetCallSummaryCommand"), exports);
5
+ tslib_1.__exportStar(require("./GetConferenceSummaryCommand"), exports);
6
+ tslib_1.__exportStar(require("./ListConversationsCommand"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WdaInsightsServiceException = void 0;
4
+ const tslib_1 = require("tslib");
5
+ tslib_1.__exportStar(require("./WdaInsightsClient"), exports);
6
+ tslib_1.__exportStar(require("./WdaInsights"), exports);
7
+ tslib_1.__exportStar(require("./commands"), exports);
8
+ tslib_1.__exportStar(require("./models"), exports);
9
+ var WdaInsightsServiceException_1 = require("./models/WdaInsightsServiceException");
10
+ Object.defineProperty(exports, "WdaInsightsServiceException", { enumerable: true, get: function () { return WdaInsightsServiceException_1.WdaInsightsServiceException; } });
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WdaInsightsServiceException = exports.__ServiceException = void 0;
4
+ const smithy_client_1 = require("@smithy/smithy-client");
5
+ Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return smithy_client_1.ServiceException; } });
6
+ class WdaInsightsServiceException extends smithy_client_1.ServiceException {
7
+ constructor(options) {
8
+ super(options);
9
+ Object.setPrototypeOf(this, WdaInsightsServiceException.prototype);
10
+ }
11
+ }
12
+ exports.WdaInsightsServiceException = WdaInsightsServiceException;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./models_0"), exports);
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListConversationsItemEvent = exports.InsightsStatus = exports.ConferenceTranscriptionStatus = exports.ConferenceParticipantType = exports.ConferenceParticipantRole = exports.ConferenceDirection = exports.ConferenceNotFoundException = exports.RecordType = exports.CallFlowTranscriptionStatus = exports.License = exports.CallDirection = exports.ConversationStatus = exports.CallDevice = exports.CallParticipantType = exports.CallParticipantRole = exports.CallFlowAttachmentType = exports.CallNotFoundException = exports.ValidationException = exports.ForbiddenException = void 0;
4
+ const WdaInsightsServiceException_1 = require("./WdaInsightsServiceException");
5
+ class ForbiddenException extends WdaInsightsServiceException_1.WdaInsightsServiceException {
6
+ constructor(opts) {
7
+ super({
8
+ name: "ForbiddenException",
9
+ $fault: "client",
10
+ ...opts
11
+ });
12
+ this.name = "ForbiddenException";
13
+ this.$fault = "client";
14
+ Object.setPrototypeOf(this, ForbiddenException.prototype);
15
+ }
16
+ }
17
+ exports.ForbiddenException = ForbiddenException;
18
+ class ValidationException extends WdaInsightsServiceException_1.WdaInsightsServiceException {
19
+ constructor(opts) {
20
+ super({
21
+ name: "ValidationException",
22
+ $fault: "client",
23
+ ...opts
24
+ });
25
+ this.name = "ValidationException";
26
+ this.$fault = "client";
27
+ Object.setPrototypeOf(this, ValidationException.prototype);
28
+ }
29
+ }
30
+ exports.ValidationException = ValidationException;
31
+ class CallNotFoundException extends WdaInsightsServiceException_1.WdaInsightsServiceException {
32
+ constructor(opts) {
33
+ super({
34
+ name: "CallNotFoundException",
35
+ $fault: "client",
36
+ ...opts
37
+ });
38
+ this.name = "CallNotFoundException";
39
+ this.$fault = "client";
40
+ Object.setPrototypeOf(this, CallNotFoundException.prototype);
41
+ }
42
+ }
43
+ exports.CallNotFoundException = CallNotFoundException;
44
+ exports.CallFlowAttachmentType = {
45
+ FAX: "FAX",
46
+ VOICEMAIL: "VOICEMAIL",
47
+ };
48
+ exports.CallParticipantRole = {
49
+ AGENT: "AGENT",
50
+ CLIENT: "CLIENT",
51
+ };
52
+ exports.CallParticipantType = {
53
+ LOCAL: "LOCAL",
54
+ REMOTE: "REMOTE",
55
+ };
56
+ exports.CallDevice = {
57
+ COLLABORATION_ANDROID: "COLLABORATION_ANDROID",
58
+ COLLABORATION_IOS: "COLLABORATION_IOS",
59
+ COLLABORATION_WEB: "COLLABORATION_WEB",
60
+ UNKNOWN: "UNKNOWN",
61
+ WILDIX_DEVICE: "WILDIX_DEVICE",
62
+ WILDIX_PHONE: "WILDIX_PHONE",
63
+ XBEES_ANDROID: "XBEES_ANDROID",
64
+ XBEES_IOS: "XBEES_IOS",
65
+ XBEES_WEB: "XBEES_WEB",
66
+ };
67
+ exports.ConversationStatus = {
68
+ COMPLETED: "COMPLETED",
69
+ MISSED: "MISSED",
70
+ };
71
+ exports.CallDirection = {
72
+ INBOUND: "INBOUND",
73
+ INTERNAL: "INTERNAL",
74
+ OUTBOUND: "OUTBOUND",
75
+ UNDEFINED: "UNDEFINED",
76
+ };
77
+ exports.License = {
78
+ XBEES: "x-bees",
79
+ };
80
+ exports.CallFlowTranscriptionStatus = {
81
+ AVAILABLE: "AVAILABLE",
82
+ UNAVAILABLE: "UNAVAILABLE",
83
+ };
84
+ exports.RecordType = {
85
+ CALL: "call",
86
+ CALL_TRANSCRIPTION: "call_transcription",
87
+ CONFERENCE: "conference",
88
+ CONFERENCE_TRANSCRIPTION: "conference_transcription",
89
+ };
90
+ class ConferenceNotFoundException extends WdaInsightsServiceException_1.WdaInsightsServiceException {
91
+ constructor(opts) {
92
+ super({
93
+ name: "ConferenceNotFoundException",
94
+ $fault: "client",
95
+ ...opts
96
+ });
97
+ this.name = "ConferenceNotFoundException";
98
+ this.$fault = "client";
99
+ Object.setPrototypeOf(this, ConferenceNotFoundException.prototype);
100
+ }
101
+ }
102
+ exports.ConferenceNotFoundException = ConferenceNotFoundException;
103
+ exports.ConferenceDirection = {
104
+ INBOUND: "INBOUND",
105
+ INTERNAL: "INTERNAL",
106
+ OUTBOUND: "OUTBOUND",
107
+ };
108
+ exports.ConferenceParticipantRole = {
109
+ AGENT: "AGENT",
110
+ CLIENT: "CLIENT",
111
+ };
112
+ exports.ConferenceParticipantType = {
113
+ EXTERNAL: "EXTERNAL",
114
+ EXTERNAL_DIAL_IN: "EXTERNAL_DIAL_IN",
115
+ PBX: "PBX",
116
+ PBX_SIP: "PBX_SIP",
117
+ XBS: "XBS",
118
+ };
119
+ exports.ConferenceTranscriptionStatus = {
120
+ AVAILABLE: "AVAILABLE",
121
+ UNAVAILABLE: "UNAVAILABLE",
122
+ };
123
+ exports.InsightsStatus = {
124
+ ERROR: "ERROR",
125
+ READY: "READY",
126
+ SCHEDULED: "SCHEDULED",
127
+ };
128
+ var ListConversationsItemEvent;
129
+ (function (ListConversationsItemEvent) {
130
+ ListConversationsItemEvent.visit = (value, visitor) => {
131
+ if (value.call !== undefined)
132
+ return visitor.call(value.call);
133
+ if (value.conference !== undefined)
134
+ return visitor.conference(value.conference);
135
+ return visitor._(value.$unknown[0], value.$unknown[1]);
136
+ };
137
+ })(ListConversationsItemEvent = exports.ListConversationsItemEvent || (exports.ListConversationsItemEvent = {}));
@@ -0,0 +1,297 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.de_ListConversationsCommand = exports.de_GetConferenceSummaryCommand = exports.de_GetCallSummaryCommand = exports.se_ListConversationsCommand = exports.se_GetConferenceSummaryCommand = exports.se_GetCallSummaryCommand = void 0;
4
+ const WdaInsightsServiceException_1 = require("../models/WdaInsightsServiceException");
5
+ const models_0_1 = require("../models/models_0");
6
+ const protocol_http_1 = require("@smithy/protocol-http");
7
+ const smithy_client_1 = require("@smithy/smithy-client");
8
+ const se_GetCallSummaryCommand = async (input, context) => {
9
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
+ const headers = {};
11
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/insights/calls/{callId}/flows/{flowIndex}/summary";
12
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'callId', () => input.callId, '{callId}', false);
13
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'flowIndex', () => input.flowIndex.toString(), '{flowIndex}', false);
14
+ const query = (0, smithy_client_1.map)({
15
+ "company": [, input.company],
16
+ "locale": [, input.locale],
17
+ });
18
+ let body;
19
+ return new protocol_http_1.HttpRequest({
20
+ protocol,
21
+ hostname,
22
+ port,
23
+ method: "GET",
24
+ headers,
25
+ path: resolvedPath,
26
+ query,
27
+ body,
28
+ });
29
+ };
30
+ exports.se_GetCallSummaryCommand = se_GetCallSummaryCommand;
31
+ const se_GetConferenceSummaryCommand = async (input, context) => {
32
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
33
+ const headers = {};
34
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/insights/conferences/{conferenceId}/summary";
35
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'conferenceId', () => input.conferenceId, '{conferenceId}', false);
36
+ const query = (0, smithy_client_1.map)({
37
+ "company": [, input.company],
38
+ "locale": [, input.locale],
39
+ });
40
+ let body;
41
+ return new protocol_http_1.HttpRequest({
42
+ protocol,
43
+ hostname,
44
+ port,
45
+ method: "GET",
46
+ headers,
47
+ path: resolvedPath,
48
+ query,
49
+ body,
50
+ });
51
+ };
52
+ exports.se_GetConferenceSummaryCommand = se_GetConferenceSummaryCommand;
53
+ const se_ListConversationsCommand = async (input, context) => {
54
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
55
+ const headers = {};
56
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/insights/conversations";
57
+ const query = (0, smithy_client_1.map)({
58
+ "company": [, input.company],
59
+ });
60
+ let body;
61
+ return new protocol_http_1.HttpRequest({
62
+ protocol,
63
+ hostname,
64
+ port,
65
+ method: "GET",
66
+ headers,
67
+ path: resolvedPath,
68
+ query,
69
+ body,
70
+ });
71
+ };
72
+ exports.se_ListConversationsCommand = se_ListConversationsCommand;
73
+ const de_GetCallSummaryCommand = async (output, context) => {
74
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
75
+ return de_GetCallSummaryCommandError(output, context);
76
+ }
77
+ const contents = (0, smithy_client_1.map)({
78
+ $metadata: deserializeMetadata(output),
79
+ });
80
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
81
+ const doc = (0, smithy_client_1.take)(data, {
82
+ 'status': smithy_client_1.expectString,
83
+ 'summary': smithy_client_1._json,
84
+ });
85
+ Object.assign(contents, doc);
86
+ return contents;
87
+ };
88
+ exports.de_GetCallSummaryCommand = de_GetCallSummaryCommand;
89
+ const de_GetCallSummaryCommandError = async (output, context) => {
90
+ const parsedOutput = {
91
+ ...output,
92
+ body: await parseErrorBody(output.body, context)
93
+ };
94
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
95
+ switch (errorCode) {
96
+ case "CallNotFoundException":
97
+ case "wildix.wda.history#CallNotFoundException":
98
+ throw await de_CallNotFoundExceptionRes(parsedOutput, context);
99
+ case "ForbiddenException":
100
+ case "smithy.framework#ForbiddenException":
101
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
102
+ case "ValidationException":
103
+ case "smithy.framework#ValidationException":
104
+ throw await de_ValidationExceptionRes(parsedOutput, context);
105
+ default:
106
+ const parsedBody = parsedOutput.body;
107
+ return throwDefaultError({
108
+ output,
109
+ parsedBody,
110
+ errorCode
111
+ });
112
+ }
113
+ };
114
+ const de_GetConferenceSummaryCommand = async (output, context) => {
115
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
116
+ return de_GetConferenceSummaryCommandError(output, context);
117
+ }
118
+ const contents = (0, smithy_client_1.map)({
119
+ $metadata: deserializeMetadata(output),
120
+ });
121
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
122
+ const doc = (0, smithy_client_1.take)(data, {
123
+ 'status': smithy_client_1.expectString,
124
+ 'summary': smithy_client_1._json,
125
+ });
126
+ Object.assign(contents, doc);
127
+ return contents;
128
+ };
129
+ exports.de_GetConferenceSummaryCommand = de_GetConferenceSummaryCommand;
130
+ const de_GetConferenceSummaryCommandError = async (output, context) => {
131
+ const parsedOutput = {
132
+ ...output,
133
+ body: await parseErrorBody(output.body, context)
134
+ };
135
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
136
+ switch (errorCode) {
137
+ case "ConferenceNotFoundException":
138
+ case "wildix.wda.history#ConferenceNotFoundException":
139
+ throw await de_ConferenceNotFoundExceptionRes(parsedOutput, context);
140
+ case "ForbiddenException":
141
+ case "smithy.framework#ForbiddenException":
142
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
143
+ case "ValidationException":
144
+ case "smithy.framework#ValidationException":
145
+ throw await de_ValidationExceptionRes(parsedOutput, context);
146
+ default:
147
+ const parsedBody = parsedOutput.body;
148
+ return throwDefaultError({
149
+ output,
150
+ parsedBody,
151
+ errorCode
152
+ });
153
+ }
154
+ };
155
+ const de_ListConversationsCommand = async (output, context) => {
156
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
157
+ return de_ListConversationsCommandError(output, context);
158
+ }
159
+ const contents = (0, smithy_client_1.map)({
160
+ $metadata: deserializeMetadata(output),
161
+ });
162
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
163
+ const doc = (0, smithy_client_1.take)(data, {
164
+ 'items': smithy_client_1._json,
165
+ });
166
+ Object.assign(contents, doc);
167
+ return contents;
168
+ };
169
+ exports.de_ListConversationsCommand = de_ListConversationsCommand;
170
+ const de_ListConversationsCommandError = async (output, context) => {
171
+ const parsedOutput = {
172
+ ...output,
173
+ body: await parseErrorBody(output.body, context)
174
+ };
175
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
176
+ switch (errorCode) {
177
+ case "ForbiddenException":
178
+ case "smithy.framework#ForbiddenException":
179
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
180
+ case "ValidationException":
181
+ case "smithy.framework#ValidationException":
182
+ throw await de_ValidationExceptionRes(parsedOutput, context);
183
+ default:
184
+ const parsedBody = parsedOutput.body;
185
+ return throwDefaultError({
186
+ output,
187
+ parsedBody,
188
+ errorCode
189
+ });
190
+ }
191
+ };
192
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(WdaInsightsServiceException_1.WdaInsightsServiceException);
193
+ const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
194
+ const contents = (0, smithy_client_1.map)({});
195
+ const data = parsedOutput.body;
196
+ const doc = (0, smithy_client_1.take)(data, {
197
+ 'message': smithy_client_1.expectString,
198
+ });
199
+ Object.assign(contents, doc);
200
+ const exception = new models_0_1.ForbiddenException({
201
+ $metadata: deserializeMetadata(parsedOutput),
202
+ ...contents
203
+ });
204
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
205
+ };
206
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
207
+ const contents = (0, smithy_client_1.map)({});
208
+ const data = parsedOutput.body;
209
+ const doc = (0, smithy_client_1.take)(data, {
210
+ 'message': smithy_client_1.expectString,
211
+ });
212
+ Object.assign(contents, doc);
213
+ const exception = new models_0_1.ValidationException({
214
+ $metadata: deserializeMetadata(parsedOutput),
215
+ ...contents
216
+ });
217
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
218
+ };
219
+ const de_CallNotFoundExceptionRes = async (parsedOutput, context) => {
220
+ const contents = (0, smithy_client_1.map)({});
221
+ const data = parsedOutput.body;
222
+ const doc = (0, smithy_client_1.take)(data, {
223
+ 'message': smithy_client_1.expectString,
224
+ });
225
+ Object.assign(contents, doc);
226
+ const exception = new models_0_1.CallNotFoundException({
227
+ $metadata: deserializeMetadata(parsedOutput),
228
+ ...contents
229
+ });
230
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
231
+ };
232
+ const de_ConferenceNotFoundExceptionRes = async (parsedOutput, context) => {
233
+ const contents = (0, smithy_client_1.map)({});
234
+ const data = parsedOutput.body;
235
+ const doc = (0, smithy_client_1.take)(data, {
236
+ 'message': smithy_client_1.expectString,
237
+ });
238
+ Object.assign(contents, doc);
239
+ const exception = new models_0_1.ConferenceNotFoundException({
240
+ $metadata: deserializeMetadata(parsedOutput),
241
+ ...contents
242
+ });
243
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
244
+ };
245
+ const deserializeMetadata = (output) => ({
246
+ httpStatusCode: output.statusCode,
247
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
248
+ extendedRequestId: output.headers["x-amz-id-2"],
249
+ cfId: output.headers["x-amz-cf-id"],
250
+ });
251
+ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
252
+ const isSerializableHeaderValue = (value) => value !== undefined &&
253
+ value !== null &&
254
+ value !== "" &&
255
+ (!Object.getOwnPropertyNames(value).includes("length") ||
256
+ value.length != 0) &&
257
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
258
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then(encoded => {
259
+ if (encoded.length) {
260
+ return JSON.parse(encoded);
261
+ }
262
+ return {};
263
+ });
264
+ const parseErrorBody = async (errorBody, context) => {
265
+ const value = await parseBody(errorBody, context);
266
+ value.message = value.message ?? value.Message;
267
+ return value;
268
+ };
269
+ const loadRestJsonErrorCode = (output, data) => {
270
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
271
+ const sanitizeErrorCode = (rawValue) => {
272
+ let cleanValue = rawValue;
273
+ if (typeof cleanValue === "number") {
274
+ cleanValue = cleanValue.toString();
275
+ }
276
+ if (cleanValue.indexOf(",") >= 0) {
277
+ cleanValue = cleanValue.split(",")[0];
278
+ }
279
+ if (cleanValue.indexOf(":") >= 0) {
280
+ cleanValue = cleanValue.split(":")[0];
281
+ }
282
+ if (cleanValue.indexOf("#") >= 0) {
283
+ cleanValue = cleanValue.split("#")[1];
284
+ }
285
+ return cleanValue;
286
+ };
287
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
288
+ if (headerKey !== undefined) {
289
+ return sanitizeErrorCode(output.headers[headerKey]);
290
+ }
291
+ if (data.code !== undefined) {
292
+ return sanitizeErrorCode(data.code);
293
+ }
294
+ if (data["__type"] !== undefined) {
295
+ return sanitizeErrorCode(data["__type"]);
296
+ }
297
+ };