@wildix/wim-voicebots-client 1.0.9 → 1.0.11

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.
@@ -5,7 +5,9 @@ const VoiceBotsClient_1 = require("./VoiceBotsClient");
5
5
  const CreateVoiceBotCommand_1 = require("./commands/CreateVoiceBotCommand");
6
6
  const DeleteVoiceBotCommand_1 = require("./commands/DeleteVoiceBotCommand");
7
7
  const DescribeEventCommand_1 = require("./commands/DescribeEventCommand");
8
+ const GetTraceCommand_1 = require("./commands/GetTraceCommand");
8
9
  const GetVoiceBotCommand_1 = require("./commands/GetVoiceBotCommand");
10
+ const ListTracesCommand_1 = require("./commands/ListTracesCommand");
9
11
  const ListVoiceBotsCommand_1 = require("./commands/ListVoiceBotsCommand");
10
12
  const ListVoiceBotsNamesCommand_1 = require("./commands/ListVoiceBotsNamesCommand");
11
13
  const SendHangupCommand_1 = require("./commands/SendHangupCommand");
@@ -17,7 +19,9 @@ const commands = {
17
19
  CreateVoiceBotCommand: CreateVoiceBotCommand_1.CreateVoiceBotCommand,
18
20
  DeleteVoiceBotCommand: DeleteVoiceBotCommand_1.DeleteVoiceBotCommand,
19
21
  DescribeEventCommand: DescribeEventCommand_1.DescribeEventCommand,
22
+ GetTraceCommand: GetTraceCommand_1.GetTraceCommand,
20
23
  GetVoiceBotCommand: GetVoiceBotCommand_1.GetVoiceBotCommand,
24
+ ListTracesCommand: ListTracesCommand_1.ListTracesCommand,
21
25
  ListVoiceBotsCommand: ListVoiceBotsCommand_1.ListVoiceBotsCommand,
22
26
  ListVoiceBotsNamesCommand: ListVoiceBotsNamesCommand_1.ListVoiceBotsNamesCommand,
23
27
  SendHangupCommand: SendHangupCommand_1.SendHangupCommand,
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetTraceCommand = 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
+ class GetTraceCommand extends smithy_client_1.Command.classBuilder()
9
+ .m(function (Command, cs, config, o) {
10
+ return [
11
+ (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
+ ];
13
+ })
14
+ .s("VoiceBots", "GetTrace", {})
15
+ .n("VoiceBotsClient", "GetTraceCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_GetTraceCommand)
18
+ .de(Aws_restJson1_1.de_GetTraceCommand)
19
+ .build() {
20
+ }
21
+ exports.GetTraceCommand = GetTraceCommand;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListTracesCommand = 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
+ class ListTracesCommand extends smithy_client_1.Command.classBuilder()
9
+ .m(function (Command, cs, config, o) {
10
+ return [
11
+ (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
+ ];
13
+ })
14
+ .s("VoiceBots", "ListTraces", {})
15
+ .n("VoiceBotsClient", "ListTracesCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_ListTracesCommand)
18
+ .de(Aws_restJson1_1.de_ListTracesCommand)
19
+ .build() {
20
+ }
21
+ exports.ListTracesCommand = ListTracesCommand;
@@ -4,7 +4,9 @@ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./CreateVoiceBotCommand"), exports);
5
5
  tslib_1.__exportStar(require("./DeleteVoiceBotCommand"), exports);
6
6
  tslib_1.__exportStar(require("./DescribeEventCommand"), exports);
7
+ tslib_1.__exportStar(require("./GetTraceCommand"), exports);
7
8
  tslib_1.__exportStar(require("./GetVoiceBotCommand"), exports);
9
+ tslib_1.__exportStar(require("./ListTracesCommand"), exports);
8
10
  tslib_1.__exportStar(require("./ListVoiceBotsCommand"), exports);
9
11
  tslib_1.__exportStar(require("./ListVoiceBotsNamesCommand"), exports);
10
12
  tslib_1.__exportStar(require("./SendHangupCommand"), exports);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VoiceSessionNotFoundException = exports.VoiceBotNotFoundException = exports.VoiceBotCommandType = exports.VoiceBotEndpoint = exports.VoiceBotToolType = exports.VoiceBotFunctionIntegration = exports.VoiceBotEmbeddedToolType = exports.VoiceBotEventType = exports.ForbiddenException = exports.ValidationException = void 0;
3
+ exports.VoiceSessionNotFoundException = exports.VoiceBotNotFoundException = exports.PubSubBroadcastItem = exports.TraceSessionStatus = exports.TraceSegmentStatus = exports.TraceSegmentResult = exports.TraceToolResult = exports.TraceSegmentInput = exports.TraceToolCall = exports.TraceSegmentCompletionMessageItem = exports.TraceActivityTrigger = exports.TraceActivityStatus = exports.TraceActivityResult = exports.VoiceBotCommandType = exports.VoiceBotEndpoint = exports.VoiceBotToolType = exports.VoiceBotFunctionIntegration = exports.VoiceBotFunctionIntegrationWebhookAuthorization = exports.VoiceBotEmbeddedToolType = exports.VoiceBotEventType = exports.ForbiddenException = exports.ValidationException = void 0;
4
4
  const VoiceBotsServiceException_1 = require("./VoiceBotsServiceException");
5
5
  class ValidationException extends VoiceBotsServiceException_1.VoiceBotsServiceException {
6
6
  constructor(opts) {
@@ -42,6 +42,18 @@ exports.VoiceBotEmbeddedToolType = {
42
42
  HANGUP: "HANGUP",
43
43
  TRANSFER: "TRANSFER",
44
44
  };
45
+ var VoiceBotFunctionIntegrationWebhookAuthorization;
46
+ (function (VoiceBotFunctionIntegrationWebhookAuthorization) {
47
+ VoiceBotFunctionIntegrationWebhookAuthorization.visit = (value, visitor) => {
48
+ if (value.bearer !== undefined)
49
+ return visitor.bearer(value.bearer);
50
+ if (value.basic !== undefined)
51
+ return visitor.basic(value.basic);
52
+ if (value.oauth !== undefined)
53
+ return visitor.oauth(value.oauth);
54
+ return visitor._(value.$unknown[0], value.$unknown[1]);
55
+ };
56
+ })(VoiceBotFunctionIntegrationWebhookAuthorization = exports.VoiceBotFunctionIntegrationWebhookAuthorization || (exports.VoiceBotFunctionIntegrationWebhookAuthorization = {}));
45
57
  var VoiceBotFunctionIntegration;
46
58
  (function (VoiceBotFunctionIntegration) {
47
59
  VoiceBotFunctionIntegration.visit = (value, visitor) => {
@@ -74,6 +86,136 @@ exports.VoiceBotCommandType = {
74
86
  SAY: "say",
75
87
  TRANSFER: "transfer",
76
88
  };
89
+ var TraceActivityResult;
90
+ (function (TraceActivityResult) {
91
+ TraceActivityResult.visit = (value, visitor) => {
92
+ if (value.error !== undefined)
93
+ return visitor.error(value.error);
94
+ if (value.text !== undefined)
95
+ return visitor.text(value.text);
96
+ return visitor._(value.$unknown[0], value.$unknown[1]);
97
+ };
98
+ })(TraceActivityResult = exports.TraceActivityResult || (exports.TraceActivityResult = {}));
99
+ exports.TraceActivityStatus = {
100
+ CANCELLED: "cancelled",
101
+ COMPLETE: "complete",
102
+ ERROR: "error",
103
+ PENDING: "pending",
104
+ };
105
+ var TraceActivityTrigger;
106
+ (function (TraceActivityTrigger) {
107
+ TraceActivityTrigger.visit = (value, visitor) => {
108
+ if (value.connectEvent !== undefined)
109
+ return visitor.connectEvent(value.connectEvent);
110
+ if (value.disconnectEvent !== undefined)
111
+ return visitor.disconnectEvent(value.disconnectEvent);
112
+ if (value.replyEvent !== undefined)
113
+ return visitor.replyEvent(value.replyEvent);
114
+ if (value.completeEvent !== undefined)
115
+ return visitor.completeEvent(value.completeEvent);
116
+ if (value.interruptionEvent !== undefined)
117
+ return visitor.interruptionEvent(value.interruptionEvent);
118
+ if (value.playbackEvent !== undefined)
119
+ return visitor.playbackEvent(value.playbackEvent);
120
+ if (value.transcriptionEvent !== undefined)
121
+ return visitor.transcriptionEvent(value.transcriptionEvent);
122
+ if (value.sayCommand !== undefined)
123
+ return visitor.sayCommand(value.sayCommand);
124
+ if (value.hangupCommand !== undefined)
125
+ return visitor.hangupCommand(value.hangupCommand);
126
+ if (value.transferCommand !== undefined)
127
+ return visitor.transferCommand(value.transferCommand);
128
+ if (value.silenceTimeoutTask !== undefined)
129
+ return visitor.silenceTimeoutTask(value.silenceTimeoutTask);
130
+ if (value.durationTimeoutTask !== undefined)
131
+ return visitor.durationTimeoutTask(value.durationTimeoutTask);
132
+ return visitor._(value.$unknown[0], value.$unknown[1]);
133
+ };
134
+ })(TraceActivityTrigger = exports.TraceActivityTrigger || (exports.TraceActivityTrigger = {}));
135
+ var TraceSegmentCompletionMessageItem;
136
+ (function (TraceSegmentCompletionMessageItem) {
137
+ TraceSegmentCompletionMessageItem.visit = (value, visitor) => {
138
+ if (value.user !== undefined)
139
+ return visitor.user(value.user);
140
+ if (value.bot !== undefined)
141
+ return visitor.bot(value.bot);
142
+ return visitor._(value.$unknown[0], value.$unknown[1]);
143
+ };
144
+ })(TraceSegmentCompletionMessageItem = exports.TraceSegmentCompletionMessageItem || (exports.TraceSegmentCompletionMessageItem = {}));
145
+ var TraceToolCall;
146
+ (function (TraceToolCall) {
147
+ TraceToolCall.visit = (value, visitor) => {
148
+ if (value.transfer !== undefined)
149
+ return visitor.transfer(value.transfer);
150
+ if (value.hangup !== undefined)
151
+ return visitor.hangup(value.hangup);
152
+ if (value.delegation !== undefined)
153
+ return visitor.delegation(value.delegation);
154
+ if (value.function !== undefined)
155
+ return visitor.function(value.function);
156
+ return visitor._(value.$unknown[0], value.$unknown[1]);
157
+ };
158
+ })(TraceToolCall = exports.TraceToolCall || (exports.TraceToolCall = {}));
159
+ var TraceSegmentInput;
160
+ (function (TraceSegmentInput) {
161
+ TraceSegmentInput.visit = (value, visitor) => {
162
+ if (value.completion !== undefined)
163
+ return visitor.completion(value.completion);
164
+ if (value.tool !== undefined)
165
+ return visitor.tool(value.tool);
166
+ return visitor._(value.$unknown[0], value.$unknown[1]);
167
+ };
168
+ })(TraceSegmentInput = exports.TraceSegmentInput || (exports.TraceSegmentInput = {}));
169
+ var TraceToolResult;
170
+ (function (TraceToolResult) {
171
+ TraceToolResult.visit = (value, visitor) => {
172
+ if (value.transfer !== undefined)
173
+ return visitor.transfer(value.transfer);
174
+ if (value.hangup !== undefined)
175
+ return visitor.hangup(value.hangup);
176
+ if (value.delegation !== undefined)
177
+ return visitor.delegation(value.delegation);
178
+ if (value.function !== undefined)
179
+ return visitor.function(value.function);
180
+ return visitor._(value.$unknown[0], value.$unknown[1]);
181
+ };
182
+ })(TraceToolResult = exports.TraceToolResult || (exports.TraceToolResult = {}));
183
+ var TraceSegmentResult;
184
+ (function (TraceSegmentResult) {
185
+ TraceSegmentResult.visit = (value, visitor) => {
186
+ if (value.error !== undefined)
187
+ return visitor.error(value.error);
188
+ if (value.tools !== undefined)
189
+ return visitor.tools(value.tools);
190
+ if (value.text !== undefined)
191
+ return visitor.text(value.text);
192
+ if (value.json !== undefined)
193
+ return visitor.json(value.json);
194
+ return visitor._(value.$unknown[0], value.$unknown[1]);
195
+ };
196
+ })(TraceSegmentResult = exports.TraceSegmentResult || (exports.TraceSegmentResult = {}));
197
+ exports.TraceSegmentStatus = {
198
+ COMPLETE: "complete",
199
+ ERROR: "error",
200
+ PENDING: "pending",
201
+ };
202
+ exports.TraceSessionStatus = {
203
+ COMPLETE: "complete",
204
+ COMPLETE_WITH_ERROR: "complete_with_error",
205
+ PENDING: "pending",
206
+ };
207
+ var PubSubBroadcastItem;
208
+ (function (PubSubBroadcastItem) {
209
+ PubSubBroadcastItem.visit = (value, visitor) => {
210
+ if (value.session !== undefined)
211
+ return visitor.session(value.session);
212
+ if (value.activity !== undefined)
213
+ return visitor.activity(value.activity);
214
+ if (value.segment !== undefined)
215
+ return visitor.segment(value.segment);
216
+ return visitor._(value.$unknown[0], value.$unknown[1]);
217
+ };
218
+ })(PubSubBroadcastItem = exports.PubSubBroadcastItem || (exports.PubSubBroadcastItem = {}));
77
219
  class VoiceBotNotFoundException extends VoiceBotsServiceException_1.VoiceBotsServiceException {
78
220
  constructor(opts) {
79
221
  super({
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateVoiceBotCommand = exports.de_SendTransferCommand = exports.de_SendSayCommand = exports.de_SendHangupCommand = exports.de_ListVoiceBotsNamesCommand = exports.de_ListVoiceBotsCommand = exports.de_GetVoiceBotCommand = exports.de_DescribeEventCommand = exports.de_DeleteVoiceBotCommand = exports.de_CreateVoiceBotCommand = exports.se_UpdateVoiceBotCommand = exports.se_SendTransferCommand = exports.se_SendSayCommand = exports.se_SendHangupCommand = exports.se_ListVoiceBotsNamesCommand = exports.se_ListVoiceBotsCommand = exports.se_GetVoiceBotCommand = exports.se_DescribeEventCommand = exports.se_DeleteVoiceBotCommand = exports.se_CreateVoiceBotCommand = void 0;
3
+ exports.de_UpdateVoiceBotCommand = exports.de_SendTransferCommand = exports.de_SendSayCommand = exports.de_SendHangupCommand = exports.de_ListVoiceBotsNamesCommand = exports.de_ListVoiceBotsCommand = exports.de_ListTracesCommand = exports.de_GetVoiceBotCommand = exports.de_GetTraceCommand = exports.de_DescribeEventCommand = exports.de_DeleteVoiceBotCommand = exports.de_CreateVoiceBotCommand = exports.se_UpdateVoiceBotCommand = exports.se_SendTransferCommand = exports.se_SendSayCommand = exports.se_SendHangupCommand = exports.se_ListVoiceBotsNamesCommand = exports.se_ListVoiceBotsCommand = exports.se_ListTracesCommand = exports.se_GetVoiceBotCommand = exports.se_GetTraceCommand = exports.se_DescribeEventCommand = exports.se_DeleteVoiceBotCommand = exports.se_CreateVoiceBotCommand = void 0;
4
4
  const VoiceBotsServiceException_1 = require("../models/VoiceBotsServiceException");
5
5
  const models_0_1 = require("../models/models_0");
6
6
  const core_1 = require("@smithy/core");
@@ -58,6 +58,22 @@ const se_DescribeEventCommand = async (input, context) => {
58
58
  return b.build();
59
59
  };
60
60
  exports.se_DescribeEventCommand = se_DescribeEventCommand;
61
+ const se_GetTraceCommand = async (input, context) => {
62
+ const b = (0, core_1.requestBuilder)(input, context);
63
+ const headers = {};
64
+ b.bp("/v2/voicebots/traces/{sessionId}");
65
+ b.p('sessionId', () => input.sessionId, '{sessionId}', false);
66
+ const query = (0, smithy_client_1.map)({
67
+ [_c]: [, input[_c]],
68
+ });
69
+ let body;
70
+ b.m("GET")
71
+ .h(headers)
72
+ .q(query)
73
+ .b(body);
74
+ return b.build();
75
+ };
76
+ exports.se_GetTraceCommand = se_GetTraceCommand;
61
77
  const se_GetVoiceBotCommand = async (input, context) => {
62
78
  const b = (0, core_1.requestBuilder)(input, context);
63
79
  const headers = {};
@@ -74,6 +90,21 @@ const se_GetVoiceBotCommand = async (input, context) => {
74
90
  return b.build();
75
91
  };
76
92
  exports.se_GetVoiceBotCommand = se_GetVoiceBotCommand;
93
+ const se_ListTracesCommand = async (input, context) => {
94
+ const b = (0, core_1.requestBuilder)(input, context);
95
+ const headers = {};
96
+ b.bp("/v2/voicebots/traces");
97
+ const query = (0, smithy_client_1.map)({
98
+ [_c]: [, input[_c]],
99
+ });
100
+ let body;
101
+ b.m("GET")
102
+ .h(headers)
103
+ .q(query)
104
+ .b(body);
105
+ return b.build();
106
+ };
107
+ exports.se_ListTracesCommand = se_ListTracesCommand;
77
108
  const se_ListVoiceBotsCommand = async (input, context) => {
78
109
  const b = (0, core_1.requestBuilder)(input, context);
79
110
  const headers = {};
@@ -224,6 +255,11 @@ const de_DescribeEventCommand = async (output, context) => {
224
255
  'InterruptionWebsocketEvent': smithy_client_1._json,
225
256
  'PlaybackWebhookEvent': smithy_client_1._json,
226
257
  'PlaybackWebsocketEvent': smithy_client_1._json,
258
+ 'PubSubBroadcastWebsocketEvent': _ => de_PubSubBroadcastWebsocketEvent(_, context),
259
+ 'PubSubSubscribeWebsocketCommand': smithy_client_1._json,
260
+ 'PubSubSubscribedWebsocketEvent': smithy_client_1._json,
261
+ 'PubSubUnsubscribeWebsocketCommand': smithy_client_1._json,
262
+ 'PubSubUnsubscribedWebsocketEvent': smithy_client_1._json,
227
263
  'ReplyWebhookEvent': smithy_client_1._json,
228
264
  'ReplyWebsocketEvent': smithy_client_1._json,
229
265
  'SayWebsocketCommand': smithy_client_1._json,
@@ -237,6 +273,21 @@ const de_DescribeEventCommand = async (output, context) => {
237
273
  return contents;
238
274
  };
239
275
  exports.de_DescribeEventCommand = de_DescribeEventCommand;
276
+ const de_GetTraceCommand = async (output, context) => {
277
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
278
+ return de_CommandError(output, context);
279
+ }
280
+ const contents = (0, smithy_client_1.map)({
281
+ $metadata: deserializeMetadata(output),
282
+ });
283
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
284
+ const doc = (0, smithy_client_1.take)(data, {
285
+ 'trace': _ => de_Trace(_, context),
286
+ });
287
+ Object.assign(contents, doc);
288
+ return contents;
289
+ };
290
+ exports.de_GetTraceCommand = de_GetTraceCommand;
240
291
  const de_GetVoiceBotCommand = async (output, context) => {
241
292
  if (output.statusCode !== 200 && output.statusCode >= 300) {
242
293
  return de_CommandError(output, context);
@@ -252,6 +303,21 @@ const de_GetVoiceBotCommand = async (output, context) => {
252
303
  return contents;
253
304
  };
254
305
  exports.de_GetVoiceBotCommand = de_GetVoiceBotCommand;
306
+ const de_ListTracesCommand = async (output, context) => {
307
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
308
+ return de_CommandError(output, context);
309
+ }
310
+ const contents = (0, smithy_client_1.map)({
311
+ $metadata: deserializeMetadata(output),
312
+ });
313
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
314
+ const doc = (0, smithy_client_1.take)(data, {
315
+ 'traces': smithy_client_1._json,
316
+ });
317
+ Object.assign(contents, doc);
318
+ return contents;
319
+ };
320
+ exports.de_ListTracesCommand = de_ListTracesCommand;
255
321
  const de_ListVoiceBotsCommand = async (output, context) => {
256
322
  if (output.statusCode !== 200 && output.statusCode >= 300) {
257
323
  return de_CommandError(output, context);
@@ -455,10 +521,9 @@ const se_VoiceBotFunctionIntegration = (input, context) => {
455
521
  const se_VoiceBotFunctionIntegrationWebhook = (input, context) => {
456
522
  return (0, smithy_client_1.take)(input, {
457
523
  'async': [],
458
- 'authorization': _ => se_Document(_, context),
524
+ 'authorization': smithy_client_1._json,
459
525
  'headers': smithy_client_1._json,
460
526
  'parameters': _ => se_Document(_, context),
461
- 'timeout': [],
462
527
  'url': [],
463
528
  });
464
529
  };
@@ -491,6 +556,183 @@ const se_BotDialogflowCxEndpoint = (input, context) => {
491
556
  const de_Document = (output, context) => {
492
557
  return output;
493
558
  };
559
+ const de_PubSubBroadcastItem = (output, context) => {
560
+ if (output.activity != null) {
561
+ return {
562
+ activity: de_TraceActivity(output.activity, context)
563
+ };
564
+ }
565
+ if (output.segment != null) {
566
+ return {
567
+ segment: de_TraceSegment(output.segment, context)
568
+ };
569
+ }
570
+ if (output.session != null) {
571
+ return {
572
+ session: (0, smithy_client_1._json)(output.session)
573
+ };
574
+ }
575
+ return { $unknown: Object.entries(output)[0] };
576
+ };
577
+ const de_PubSubBroadcastItems = (output, context) => {
578
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
579
+ return de_PubSubBroadcastItem((0, smithy_client_1.expectUnion)(entry), context);
580
+ });
581
+ return retVal;
582
+ };
583
+ const de_PubSubBroadcastWebsocketEvent = (output, context) => {
584
+ return (0, smithy_client_1.take)(output, {
585
+ 'event': smithy_client_1.expectString,
586
+ 'items': (_) => de_PubSubBroadcastItems(_, context),
587
+ 'topic': smithy_client_1.expectString,
588
+ });
589
+ };
590
+ const de_Trace = (output, context) => {
591
+ return (0, smithy_client_1.take)(output, {
592
+ 'activities': (_) => de_TraceActivitiesList(_, context),
593
+ 'segments': (_) => de_TraceSegmentsList(_, context),
594
+ 'session': smithy_client_1._json,
595
+ });
596
+ };
597
+ const de_TraceActivitiesList = (output, context) => {
598
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
599
+ return de_TraceActivity(entry, context);
600
+ });
601
+ return retVal;
602
+ };
603
+ const de_TraceActivity = (output, context) => {
604
+ return (0, smithy_client_1.take)(output, {
605
+ 'duration': smithy_client_1.expectInt32,
606
+ 'id': smithy_client_1.expectString,
607
+ 'result': (_) => (0, smithy_client_1._json)((0, smithy_client_1.expectUnion)(_)),
608
+ 'start': smithy_client_1.expectInt32,
609
+ 'status': smithy_client_1.expectString,
610
+ 'trigger': (_) => de_TraceActivityTrigger((0, smithy_client_1.expectUnion)(_), context),
611
+ 'version': smithy_client_1.expectInt32,
612
+ });
613
+ };
614
+ const de_TraceActivityTrigger = (output, context) => {
615
+ if (output.completeEvent != null) {
616
+ return {
617
+ completeEvent: (0, smithy_client_1._json)(output.completeEvent)
618
+ };
619
+ }
620
+ if (output.connectEvent != null) {
621
+ return {
622
+ connectEvent: de_TraceConnectEventTrigger(output.connectEvent, context)
623
+ };
624
+ }
625
+ if (output.disconnectEvent != null) {
626
+ return {
627
+ disconnectEvent: de_TraceDisconnectEventTrigger(output.disconnectEvent, context)
628
+ };
629
+ }
630
+ if (output.durationTimeoutTask != null) {
631
+ return {
632
+ durationTimeoutTask: de_TraceDurationTimeoutTaskTrigger(output.durationTimeoutTask, context)
633
+ };
634
+ }
635
+ if (output.hangupCommand != null) {
636
+ return {
637
+ hangupCommand: (0, smithy_client_1._json)(output.hangupCommand)
638
+ };
639
+ }
640
+ if (output.interruptionEvent != null) {
641
+ return {
642
+ interruptionEvent: (0, smithy_client_1._json)(output.interruptionEvent)
643
+ };
644
+ }
645
+ if (output.playbackEvent != null) {
646
+ return {
647
+ playbackEvent: (0, smithy_client_1._json)(output.playbackEvent)
648
+ };
649
+ }
650
+ if (output.replyEvent != null) {
651
+ return {
652
+ replyEvent: (0, smithy_client_1._json)(output.replyEvent)
653
+ };
654
+ }
655
+ if (output.sayCommand != null) {
656
+ return {
657
+ sayCommand: (0, smithy_client_1._json)(output.sayCommand)
658
+ };
659
+ }
660
+ if (output.silenceTimeoutTask != null) {
661
+ return {
662
+ silenceTimeoutTask: de_TraceSilenceTimeoutTaskTrigger(output.silenceTimeoutTask, context)
663
+ };
664
+ }
665
+ if (output.transcriptionEvent != null) {
666
+ return {
667
+ transcriptionEvent: (0, smithy_client_1._json)(output.transcriptionEvent)
668
+ };
669
+ }
670
+ if (output.transferCommand != null) {
671
+ return {
672
+ transferCommand: (0, smithy_client_1._json)(output.transferCommand)
673
+ };
674
+ }
675
+ return { $unknown: Object.entries(output)[0] };
676
+ };
677
+ const de_TraceConnectEventTrigger = (output, context) => {
678
+ return (0, smithy_client_1.take)(output, {
679
+ 'parameters': (_) => de_Document(_, context),
680
+ });
681
+ };
682
+ const de_TraceDisconnectEventTrigger = (output, context) => {
683
+ return (0, smithy_client_1.take)(output, {
684
+ 'parameters': (_) => de_Document(_, context),
685
+ });
686
+ };
687
+ const de_TraceDurationTimeoutTaskTrigger = (output, context) => {
688
+ return (0, smithy_client_1.take)(output, {
689
+ 'parameters': (_) => de_Document(_, context),
690
+ });
691
+ };
692
+ const de_TraceSegment = (output, context) => {
693
+ return (0, smithy_client_1.take)(output, {
694
+ 'activityId': smithy_client_1.expectString,
695
+ 'duration': smithy_client_1.expectInt32,
696
+ 'id': smithy_client_1.expectString,
697
+ 'input': (_) => (0, smithy_client_1._json)((0, smithy_client_1.expectUnion)(_)),
698
+ 'result': (_) => de_TraceSegmentResult((0, smithy_client_1.expectUnion)(_), context),
699
+ 'start': smithy_client_1.expectInt32,
700
+ 'status': smithy_client_1.expectString,
701
+ 'version': smithy_client_1.expectInt32,
702
+ });
703
+ };
704
+ const de_TraceSegmentResult = (output, context) => {
705
+ if (output.error != null) {
706
+ return {
707
+ error: (0, smithy_client_1._json)(output.error)
708
+ };
709
+ }
710
+ if (output.json != null) {
711
+ return {
712
+ json: de_Document(output.json, context)
713
+ };
714
+ }
715
+ if ((0, smithy_client_1.expectString)(output.text) !== undefined) {
716
+ return { text: (0, smithy_client_1.expectString)(output.text) };
717
+ }
718
+ if (output.tools != null) {
719
+ return {
720
+ tools: (0, smithy_client_1._json)(output.tools)
721
+ };
722
+ }
723
+ return { $unknown: Object.entries(output)[0] };
724
+ };
725
+ const de_TraceSegmentsList = (output, context) => {
726
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
727
+ return de_TraceSegment(entry, context);
728
+ });
729
+ return retVal;
730
+ };
731
+ const de_TraceSilenceTimeoutTaskTrigger = (output, context) => {
732
+ return (0, smithy_client_1.take)(output, {
733
+ 'parameters': (_) => de_Document(_, context),
734
+ });
735
+ };
494
736
  const de_VoiceBot = (output, context) => {
495
737
  return (0, smithy_client_1.take)(output, {
496
738
  'createdAt': smithy_client_1.expectString,
@@ -562,10 +804,9 @@ const de_VoiceBotFunctionIntegration = (output, context) => {
562
804
  const de_VoiceBotFunctionIntegrationWebhook = (output, context) => {
563
805
  return (0, smithy_client_1.take)(output, {
564
806
  'async': smithy_client_1.expectBoolean,
565
- 'authorization': (_) => de_Document(_, context),
807
+ 'authorization': (_) => (0, smithy_client_1._json)((0, smithy_client_1.expectUnion)(_)),
566
808
  'headers': smithy_client_1._json,
567
809
  'parameters': (_) => de_Document(_, context),
568
- 'timeout': smithy_client_1.expectInt32,
569
810
  'url': smithy_client_1.expectString,
570
811
  });
571
812
  };
@@ -2,7 +2,9 @@ import { VoiceBotsClient, } from "./VoiceBotsClient";
2
2
  import { CreateVoiceBotCommand, } from "./commands/CreateVoiceBotCommand";
3
3
  import { DeleteVoiceBotCommand, } from "./commands/DeleteVoiceBotCommand";
4
4
  import { DescribeEventCommand, } from "./commands/DescribeEventCommand";
5
+ import { GetTraceCommand, } from "./commands/GetTraceCommand";
5
6
  import { GetVoiceBotCommand, } from "./commands/GetVoiceBotCommand";
7
+ import { ListTracesCommand, } from "./commands/ListTracesCommand";
6
8
  import { ListVoiceBotsCommand, } from "./commands/ListVoiceBotsCommand";
7
9
  import { ListVoiceBotsNamesCommand, } from "./commands/ListVoiceBotsNamesCommand";
8
10
  import { SendHangupCommand, } from "./commands/SendHangupCommand";
@@ -14,7 +16,9 @@ const commands = {
14
16
  CreateVoiceBotCommand,
15
17
  DeleteVoiceBotCommand,
16
18
  DescribeEventCommand,
19
+ GetTraceCommand,
17
20
  GetVoiceBotCommand,
21
+ ListTracesCommand,
18
22
  ListVoiceBotsCommand,
19
23
  ListVoiceBotsNamesCommand,
20
24
  SendHangupCommand,
@@ -0,0 +1,17 @@
1
+ import { de_GetTraceCommand, se_GetTraceCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ export { $Command };
5
+ export class GetTraceCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("VoiceBots", "GetTrace", {})
12
+ .n("VoiceBotsClient", "GetTraceCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_GetTraceCommand)
15
+ .de(de_GetTraceCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_ListTracesCommand, se_ListTracesCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ export { $Command };
5
+ export class ListTracesCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("VoiceBots", "ListTraces", {})
12
+ .n("VoiceBotsClient", "ListTracesCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_ListTracesCommand)
15
+ .de(de_ListTracesCommand)
16
+ .build() {
17
+ }
@@ -1,7 +1,9 @@
1
1
  export * from "./CreateVoiceBotCommand";
2
2
  export * from "./DeleteVoiceBotCommand";
3
3
  export * from "./DescribeEventCommand";
4
+ export * from "./GetTraceCommand";
4
5
  export * from "./GetVoiceBotCommand";
6
+ export * from "./ListTracesCommand";
5
7
  export * from "./ListVoiceBotsCommand";
6
8
  export * from "./ListVoiceBotsNamesCommand";
7
9
  export * from "./SendHangupCommand";