@wildix/xbees-conversations-client 1.0.28 → 1.0.30

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 (35) hide show
  1. package/dist-cjs/Conversations.js +10 -0
  2. package/dist-cjs/commands/DeleteMessageCommand.js +41 -0
  3. package/dist-cjs/commands/ListChannelsCommand.js +41 -0
  4. package/dist-cjs/commands/ListMessagesCommand.js +41 -0
  5. package/dist-cjs/commands/PartialUpdateMessageCommand.js +41 -0
  6. package/dist-cjs/commands/UpdateMessageCommand.js +41 -0
  7. package/dist-cjs/commands/index.js +5 -0
  8. package/dist-cjs/models/models_0.js +32 -11
  9. package/dist-cjs/protocols/Aws_restJson1.js +353 -3
  10. package/dist-es/Conversations.js +10 -0
  11. package/dist-es/commands/DeleteMessageCommand.js +37 -0
  12. package/dist-es/commands/ListChannelsCommand.js +37 -0
  13. package/dist-es/commands/ListMessagesCommand.js +37 -0
  14. package/dist-es/commands/PartialUpdateMessageCommand.js +37 -0
  15. package/dist-es/commands/UpdateMessageCommand.js +37 -0
  16. package/dist-es/commands/index.js +5 -0
  17. package/dist-es/models/models_0.js +28 -8
  18. package/dist-es/protocols/Aws_restJson1.js +343 -3
  19. package/dist-types/Conversations.d.ts +35 -0
  20. package/dist-types/ConversationsClient.d.ts +7 -2
  21. package/dist-types/commands/CreateChannelCommand.d.ts +1 -0
  22. package/dist-types/commands/CreateMessageCommand.d.ts +1 -1
  23. package/dist-types/commands/DeleteMessageCommand.d.ts +76 -0
  24. package/dist-types/commands/GetMessageCommand.d.ts +1 -0
  25. package/dist-types/commands/JoinChannelCommand.d.ts +1 -0
  26. package/dist-types/commands/ListChannelsCommand.d.ts +139 -0
  27. package/dist-types/commands/ListMessagesCommand.d.ts +211 -0
  28. package/dist-types/commands/PartialUpdateChannelCommand.d.ts +1 -0
  29. package/dist-types/commands/PartialUpdateMessageCommand.d.ts +365 -0
  30. package/dist-types/commands/UpdateChannelCommand.d.ts +1 -0
  31. package/dist-types/commands/UpdateMessageCommand.d.ts +362 -0
  32. package/dist-types/commands/index.d.ts +5 -0
  33. package/dist-types/models/models_0.d.ts +124 -7
  34. package/dist-types/protocols/Aws_restJson1.d.ts +45 -0
  35. package/package.json +2 -2
@@ -0,0 +1,37 @@
1
+ import { de_PartialUpdateMessageCommand, se_PartialUpdateMessageCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ export { $Command };
6
+ export class PartialUpdateMessageCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ resolveMiddleware(clientStack, configuration, options) {
12
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
13
+ const stack = clientStack.concat(this.middlewareStack);
14
+ const { logger } = configuration;
15
+ const clientName = "ConversationsClient";
16
+ const commandName = "PartialUpdateMessageCommand";
17
+ const handlerExecutionContext = {
18
+ logger,
19
+ clientName,
20
+ commandName,
21
+ inputFilterSensitiveLog: (_) => _,
22
+ outputFilterSensitiveLog: (_) => _,
23
+ [SMITHY_CONTEXT_KEY]: {
24
+ service: "Conversations",
25
+ operation: "PartialUpdateMessage",
26
+ },
27
+ };
28
+ const { requestHandler } = configuration;
29
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
30
+ }
31
+ serialize(input, context) {
32
+ return se_PartialUpdateMessageCommand(input, context);
33
+ }
34
+ deserialize(output, context) {
35
+ return de_PartialUpdateMessageCommand(output, context);
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ import { de_UpdateMessageCommand, se_UpdateMessageCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ export { $Command };
6
+ export class UpdateMessageCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ resolveMiddleware(clientStack, configuration, options) {
12
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
13
+ const stack = clientStack.concat(this.middlewareStack);
14
+ const { logger } = configuration;
15
+ const clientName = "ConversationsClient";
16
+ const commandName = "UpdateMessageCommand";
17
+ const handlerExecutionContext = {
18
+ logger,
19
+ clientName,
20
+ commandName,
21
+ inputFilterSensitiveLog: (_) => _,
22
+ outputFilterSensitiveLog: (_) => _,
23
+ [SMITHY_CONTEXT_KEY]: {
24
+ service: "Conversations",
25
+ operation: "UpdateMessage",
26
+ },
27
+ };
28
+ const { requestHandler } = configuration;
29
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
30
+ }
31
+ serialize(input, context) {
32
+ return se_UpdateMessageCommand(input, context);
33
+ }
34
+ deserialize(output, context) {
35
+ return de_UpdateMessageCommand(output, context);
36
+ }
37
+ }
@@ -1,10 +1,15 @@
1
1
  export * from "./CreateChannelCommand";
2
2
  export * from "./CreateMessageCommand";
3
3
  export * from "./DeleteChannelCommand";
4
+ export * from "./DeleteMessageCommand";
4
5
  export * from "./GetChannelCommand";
5
6
  export * from "./GetChannelMemberCommand";
6
7
  export * from "./GetMessageCommand";
7
8
  export * from "./JoinChannelCommand";
9
+ export * from "./ListChannelsCommand";
10
+ export * from "./ListMessagesCommand";
8
11
  export * from "./PartialUpdateChannelCommand";
12
+ export * from "./PartialUpdateMessageCommand";
9
13
  export * from "./ScheduleExternalFlagAdjustmentJobCommand";
10
14
  export * from "./UpdateChannelCommand";
15
+ export * from "./UpdateMessageCommand";
@@ -1,26 +1,26 @@
1
1
  import { ConversationsServiceException as __BaseException } from "./ConversationsServiceException";
2
- export class ValidationException extends __BaseException {
2
+ export class ForbiddenException extends __BaseException {
3
3
  constructor(opts) {
4
4
  super({
5
- name: "ValidationException",
5
+ name: "ForbiddenException",
6
6
  $fault: "client",
7
7
  ...opts
8
8
  });
9
- this.name = "ValidationException";
9
+ this.name = "ForbiddenException";
10
10
  this.$fault = "client";
11
- Object.setPrototypeOf(this, ValidationException.prototype);
11
+ Object.setPrototypeOf(this, ForbiddenException.prototype);
12
12
  }
13
13
  }
14
- export class ForbiddenException extends __BaseException {
14
+ export class ValidationException extends __BaseException {
15
15
  constructor(opts) {
16
16
  super({
17
- name: "ForbiddenException",
17
+ name: "ValidationException",
18
18
  $fault: "client",
19
19
  ...opts
20
20
  });
21
- this.name = "ForbiddenException";
21
+ this.name = "ValidationException";
22
22
  this.$fault = "client";
23
- Object.setPrototypeOf(this, ForbiddenException.prototype);
23
+ Object.setPrototypeOf(this, ValidationException.prototype);
24
24
  }
25
25
  }
26
26
  export const ChannelType = {
@@ -89,6 +89,18 @@ export const MessageSmsStatus = {
89
89
  export const MessageType = {
90
90
  REGULAR: "regular",
91
91
  };
92
+ export class MessageNotFoundException extends __BaseException {
93
+ constructor(opts) {
94
+ super({
95
+ name: "MessageNotFoundException",
96
+ $fault: "client",
97
+ ...opts
98
+ });
99
+ this.name = "MessageNotFoundException";
100
+ this.$fault = "client";
101
+ Object.setPrototypeOf(this, MessageNotFoundException.prototype);
102
+ }
103
+ }
92
104
  export class MemberNotFoundException extends __BaseException {
93
105
  constructor(opts) {
94
106
  super({
@@ -101,6 +113,14 @@ export class MemberNotFoundException extends __BaseException {
101
113
  Object.setPrototypeOf(this, MemberNotFoundException.prototype);
102
114
  }
103
115
  }
116
+ export const MessageUnsetFields = {
117
+ ATTACHMENTS: "attachments",
118
+ EVENT: "event",
119
+ FORWARD: "forward",
120
+ QUOTE: "quote",
121
+ SMS: "sms",
122
+ SMS_STATUS: "smsStatus",
123
+ };
104
124
  export class ConversationsServiceException extends __BaseException {
105
125
  constructor(opts) {
106
126
  super({
@@ -1,5 +1,5 @@
1
1
  import { ConversationsServiceException as __BaseException } from "../models/ConversationsServiceException";
2
- import { ChannelNotFoundException, ConversationsServiceException, ForbiddenException, MemberNotFoundException, ValidationException, } from "../models/models_0";
2
+ import { ChannelNotFoundException, ConversationsServiceException, ForbiddenException, MemberNotFoundException, MessageNotFoundException, ValidationException, } from "../models/models_0";
3
3
  import { HttpRequest as __HttpRequest, } from "@smithy/protocol-http";
4
4
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, resolvedPath as __resolvedPath, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
5
5
  export const se_CreateChannelCommand = async (input, context) => {
@@ -8,6 +8,9 @@ export const se_CreateChannelCommand = async (input, context) => {
8
8
  'content-type': 'application/json',
9
9
  };
10
10
  let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels";
11
+ const query = map({
12
+ "user": [, input.userId],
13
+ });
11
14
  let body;
12
15
  body = JSON.stringify(take(input, {
13
16
  'channel': _ => _json(_),
@@ -19,6 +22,7 @@ export const se_CreateChannelCommand = async (input, context) => {
19
22
  method: "POST",
20
23
  headers,
21
24
  path: resolvedPath,
25
+ query,
22
26
  body,
23
27
  });
24
28
  };
@@ -30,7 +34,7 @@ export const se_CreateMessageCommand = async (input, context) => {
30
34
  let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages";
31
35
  resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
32
36
  const query = map({
33
- "user_id": [, __expectNonNull(input.userId, `userId`)],
37
+ "user": [, input.userId],
34
38
  });
35
39
  let body;
36
40
  body = JSON.stringify(take(input, {
@@ -63,6 +67,23 @@ export const se_DeleteChannelCommand = async (input, context) => {
63
67
  body,
64
68
  });
65
69
  };
70
+ export const se_DeleteMessageCommand = async (input, context) => {
71
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
72
+ const headers = {};
73
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages/{messageId}";
74
+ resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
75
+ resolvedPath = __resolvedPath(resolvedPath, input, 'messageId', () => input.messageId, '{messageId}', false);
76
+ let body;
77
+ return new __HttpRequest({
78
+ protocol,
79
+ hostname,
80
+ port,
81
+ method: "DELETE",
82
+ headers,
83
+ path: resolvedPath,
84
+ body,
85
+ });
86
+ };
66
87
  export const se_GetChannelCommand = async (input, context) => {
67
88
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
68
89
  const headers = {};
@@ -99,8 +120,9 @@ export const se_GetChannelMemberCommand = async (input, context) => {
99
120
  export const se_GetMessageCommand = async (input, context) => {
100
121
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
101
122
  const headers = {};
102
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages";
123
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages/{messageId}";
103
124
  resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
125
+ resolvedPath = __resolvedPath(resolvedPath, input, 'messageId', () => input.messageId, '{messageId}', false);
104
126
  let body;
105
127
  return new __HttpRequest({
106
128
  protocol,
@@ -117,6 +139,9 @@ export const se_JoinChannelCommand = async (input, context) => {
117
139
  const headers = {};
118
140
  let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/join";
119
141
  resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
142
+ const query = map({
143
+ "user": [, input.userId],
144
+ });
120
145
  let body;
121
146
  return new __HttpRequest({
122
147
  protocol,
@@ -125,6 +150,44 @@ export const se_JoinChannelCommand = async (input, context) => {
125
150
  method: "POST",
126
151
  headers,
127
152
  path: resolvedPath,
153
+ query,
154
+ body,
155
+ });
156
+ };
157
+ export const se_ListChannelsCommand = async (input, context) => {
158
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
159
+ const headers = {};
160
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels";
161
+ const query = map({
162
+ "user": [, input.userId],
163
+ "limit": [() => input.limit !== void 0, () => (input.limit.toString())],
164
+ "offset": [() => input.offset !== void 0, () => (input.offset.toString())],
165
+ });
166
+ let body;
167
+ return new __HttpRequest({
168
+ protocol,
169
+ hostname,
170
+ port,
171
+ method: "GET",
172
+ headers,
173
+ path: resolvedPath,
174
+ query,
175
+ body,
176
+ });
177
+ };
178
+ export const se_ListMessagesCommand = async (input, context) => {
179
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
180
+ const headers = {};
181
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages";
182
+ resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
183
+ let body;
184
+ return new __HttpRequest({
185
+ protocol,
186
+ hostname,
187
+ port,
188
+ method: "GET",
189
+ headers,
190
+ path: resolvedPath,
128
191
  body,
129
192
  });
130
193
  };
@@ -135,6 +198,9 @@ export const se_PartialUpdateChannelCommand = async (input, context) => {
135
198
  };
136
199
  let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}";
137
200
  resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
201
+ const query = map({
202
+ "user": [, input.userId],
203
+ });
138
204
  let body;
139
205
  body = JSON.stringify(take(input, {
140
206
  'set': _ => _json(_),
@@ -147,6 +213,34 @@ export const se_PartialUpdateChannelCommand = async (input, context) => {
147
213
  method: "PATCH",
148
214
  headers,
149
215
  path: resolvedPath,
216
+ query,
217
+ body,
218
+ });
219
+ };
220
+ export const se_PartialUpdateMessageCommand = async (input, context) => {
221
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
222
+ const headers = {
223
+ 'content-type': 'application/json',
224
+ };
225
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages/{messageId}";
226
+ resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
227
+ resolvedPath = __resolvedPath(resolvedPath, input, 'messageId', () => input.messageId, '{messageId}', false);
228
+ const query = map({
229
+ "user": [, input.userId],
230
+ });
231
+ let body;
232
+ body = JSON.stringify(take(input, {
233
+ 'set': _ => se_MessageUpdateFields(_, context),
234
+ 'unset': _ => _json(_),
235
+ }));
236
+ return new __HttpRequest({
237
+ protocol,
238
+ hostname,
239
+ port,
240
+ method: "PATCH",
241
+ headers,
242
+ path: resolvedPath,
243
+ query,
150
244
  body,
151
245
  });
152
246
  };
@@ -177,6 +271,9 @@ export const se_UpdateChannelCommand = async (input, context) => {
177
271
  };
178
272
  let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}";
179
273
  resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
274
+ const query = map({
275
+ "user": [, input.userId],
276
+ });
180
277
  let body;
181
278
  body = JSON.stringify(take(input, {
182
279
  'channel': _ => _json(_),
@@ -188,6 +285,33 @@ export const se_UpdateChannelCommand = async (input, context) => {
188
285
  method: "PUT",
189
286
  headers,
190
287
  path: resolvedPath,
288
+ query,
289
+ body,
290
+ });
291
+ };
292
+ export const se_UpdateMessageCommand = async (input, context) => {
293
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
294
+ const headers = {
295
+ 'content-type': 'application/json',
296
+ };
297
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages/{messageId}";
298
+ resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
299
+ resolvedPath = __resolvedPath(resolvedPath, input, 'messageId', () => input.messageId, '{messageId}', false);
300
+ const query = map({
301
+ "user": [, input.userId],
302
+ });
303
+ let body;
304
+ body = JSON.stringify(take(input, {
305
+ 'message': _ => se_MessageUpdateFields(_, context),
306
+ }));
307
+ return new __HttpRequest({
308
+ protocol,
309
+ hostname,
310
+ port,
311
+ method: "PUT",
312
+ headers,
313
+ path: resolvedPath,
314
+ query,
191
315
  body,
192
316
  });
193
317
  };
@@ -295,6 +419,41 @@ const de_DeleteChannelCommandError = async (output, context) => {
295
419
  });
296
420
  }
297
421
  };
422
+ export const de_DeleteMessageCommand = async (output, context) => {
423
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
424
+ return de_DeleteMessageCommandError(output, context);
425
+ }
426
+ const contents = map({
427
+ $metadata: deserializeMetadata(output),
428
+ });
429
+ await collectBody(output.body, context);
430
+ return contents;
431
+ };
432
+ const de_DeleteMessageCommandError = async (output, context) => {
433
+ const parsedOutput = {
434
+ ...output,
435
+ body: await parseErrorBody(output.body, context)
436
+ };
437
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
438
+ switch (errorCode) {
439
+ case "ChannelNotFoundException":
440
+ case "wildix.xbees.conversations#ChannelNotFoundException":
441
+ throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
442
+ case "MessageNotFoundException":
443
+ case "wildix.xbees.conversations#MessageNotFoundException":
444
+ throw await de_MessageNotFoundExceptionRes(parsedOutput, context);
445
+ case "ValidationException":
446
+ case "smithy.framework#ValidationException":
447
+ throw await de_ValidationExceptionRes(parsedOutput, context);
448
+ default:
449
+ const parsedBody = parsedOutput.body;
450
+ return throwDefaultError({
451
+ output,
452
+ parsedBody,
453
+ errorCode
454
+ });
455
+ }
456
+ };
298
457
  export const de_GetChannelCommand = async (output, context) => {
299
458
  if (output.statusCode !== 200 && output.statusCode >= 300) {
300
459
  return de_GetChannelCommandError(output, context);
@@ -445,6 +604,75 @@ const de_JoinChannelCommandError = async (output, context) => {
445
604
  });
446
605
  }
447
606
  };
607
+ export const de_ListChannelsCommand = async (output, context) => {
608
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
609
+ return de_ListChannelsCommandError(output, context);
610
+ }
611
+ const contents = map({
612
+ $metadata: deserializeMetadata(output),
613
+ });
614
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
615
+ const doc = take(data, {
616
+ 'channels': _json,
617
+ });
618
+ Object.assign(contents, doc);
619
+ return contents;
620
+ };
621
+ const de_ListChannelsCommandError = async (output, context) => {
622
+ const parsedOutput = {
623
+ ...output,
624
+ body: await parseErrorBody(output.body, context)
625
+ };
626
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
627
+ switch (errorCode) {
628
+ case "ValidationException":
629
+ case "smithy.framework#ValidationException":
630
+ throw await de_ValidationExceptionRes(parsedOutput, context);
631
+ default:
632
+ const parsedBody = parsedOutput.body;
633
+ return throwDefaultError({
634
+ output,
635
+ parsedBody,
636
+ errorCode
637
+ });
638
+ }
639
+ };
640
+ export const de_ListMessagesCommand = async (output, context) => {
641
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
642
+ return de_ListMessagesCommandError(output, context);
643
+ }
644
+ const contents = map({
645
+ $metadata: deserializeMetadata(output),
646
+ });
647
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
648
+ const doc = take(data, {
649
+ 'messages': _ => de_MessagesList(_, context),
650
+ });
651
+ Object.assign(contents, doc);
652
+ return contents;
653
+ };
654
+ const de_ListMessagesCommandError = async (output, context) => {
655
+ const parsedOutput = {
656
+ ...output,
657
+ body: await parseErrorBody(output.body, context)
658
+ };
659
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
660
+ switch (errorCode) {
661
+ case "ChannelNotFoundException":
662
+ case "wildix.xbees.conversations#ChannelNotFoundException":
663
+ throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
664
+ case "ValidationException":
665
+ case "smithy.framework#ValidationException":
666
+ throw await de_ValidationExceptionRes(parsedOutput, context);
667
+ default:
668
+ const parsedBody = parsedOutput.body;
669
+ return throwDefaultError({
670
+ output,
671
+ parsedBody,
672
+ errorCode
673
+ });
674
+ }
675
+ };
448
676
  export const de_PartialUpdateChannelCommand = async (output, context) => {
449
677
  if (output.statusCode !== 200 && output.statusCode >= 300) {
450
678
  return de_PartialUpdateChannelCommandError(output, context);
@@ -481,6 +709,45 @@ const de_PartialUpdateChannelCommandError = async (output, context) => {
481
709
  });
482
710
  }
483
711
  };
712
+ export const de_PartialUpdateMessageCommand = async (output, context) => {
713
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
714
+ return de_PartialUpdateMessageCommandError(output, context);
715
+ }
716
+ const contents = map({
717
+ $metadata: deserializeMetadata(output),
718
+ });
719
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
720
+ const doc = take(data, {
721
+ 'message': _ => de_Message(_, context),
722
+ });
723
+ Object.assign(contents, doc);
724
+ return contents;
725
+ };
726
+ const de_PartialUpdateMessageCommandError = async (output, context) => {
727
+ const parsedOutput = {
728
+ ...output,
729
+ body: await parseErrorBody(output.body, context)
730
+ };
731
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
732
+ switch (errorCode) {
733
+ case "ChannelNotFoundException":
734
+ case "wildix.xbees.conversations#ChannelNotFoundException":
735
+ throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
736
+ case "MessageNotFoundException":
737
+ case "wildix.xbees.conversations#MessageNotFoundException":
738
+ throw await de_MessageNotFoundExceptionRes(parsedOutput, context);
739
+ case "ValidationException":
740
+ case "smithy.framework#ValidationException":
741
+ throw await de_ValidationExceptionRes(parsedOutput, context);
742
+ default:
743
+ const parsedBody = parsedOutput.body;
744
+ return throwDefaultError({
745
+ output,
746
+ parsedBody,
747
+ errorCode
748
+ });
749
+ }
750
+ };
484
751
  export const de_ScheduleExternalFlagAdjustmentJobCommand = async (output, context) => {
485
752
  if (output.statusCode !== 200 && output.statusCode >= 300) {
486
753
  return de_ScheduleExternalFlagAdjustmentJobCommandError(output, context);
@@ -552,6 +819,45 @@ const de_UpdateChannelCommandError = async (output, context) => {
552
819
  });
553
820
  }
554
821
  };
822
+ export const de_UpdateMessageCommand = async (output, context) => {
823
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
824
+ return de_UpdateMessageCommandError(output, context);
825
+ }
826
+ const contents = map({
827
+ $metadata: deserializeMetadata(output),
828
+ });
829
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
830
+ const doc = take(data, {
831
+ 'message': _ => de_Message(_, context),
832
+ });
833
+ Object.assign(contents, doc);
834
+ return contents;
835
+ };
836
+ const de_UpdateMessageCommandError = async (output, context) => {
837
+ const parsedOutput = {
838
+ ...output,
839
+ body: await parseErrorBody(output.body, context)
840
+ };
841
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
842
+ switch (errorCode) {
843
+ case "ChannelNotFoundException":
844
+ case "wildix.xbees.conversations#ChannelNotFoundException":
845
+ throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
846
+ case "MessageNotFoundException":
847
+ case "wildix.xbees.conversations#MessageNotFoundException":
848
+ throw await de_MessageNotFoundExceptionRes(parsedOutput, context);
849
+ case "ValidationException":
850
+ case "smithy.framework#ValidationException":
851
+ throw await de_ValidationExceptionRes(parsedOutput, context);
852
+ default:
853
+ const parsedBody = parsedOutput.body;
854
+ return throwDefaultError({
855
+ output,
856
+ parsedBody,
857
+ errorCode
858
+ });
859
+ }
860
+ };
555
861
  const throwDefaultError = withBaseException(__BaseException);
556
862
  const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
557
863
  const contents = map({});
@@ -618,6 +924,19 @@ const de_MemberNotFoundExceptionRes = async (parsedOutput, context) => {
618
924
  });
619
925
  return __decorateServiceException(exception, parsedOutput.body);
620
926
  };
927
+ const de_MessageNotFoundExceptionRes = async (parsedOutput, context) => {
928
+ const contents = map({});
929
+ const data = parsedOutput.body;
930
+ const doc = take(data, {
931
+ 'message': __expectString,
932
+ });
933
+ Object.assign(contents, doc);
934
+ const exception = new MessageNotFoundException({
935
+ $metadata: deserializeMetadata(parsedOutput),
936
+ ...contents
937
+ });
938
+ return __decorateServiceException(exception, parsedOutput.body);
939
+ };
621
940
  const se_Message = (input, context) => {
622
941
  return take(input, {
623
942
  'attachments': _json,
@@ -657,6 +976,21 @@ const se_MessageCreateFields = (input, context) => {
657
976
  'type': [],
658
977
  });
659
978
  };
979
+ const se_MessageUpdateFields = (input, context) => {
980
+ return take(input, {
981
+ 'attachments': _json,
982
+ 'event': [],
983
+ 'forward': _json,
984
+ 'giphy': _json,
985
+ 'mentions': _json,
986
+ 'quote': _ => se_Message(_, context),
987
+ 'silent': [],
988
+ 'sms': [],
989
+ 'smsStatus': [],
990
+ 'text': [],
991
+ 'type': [],
992
+ });
993
+ };
660
994
  const de_Message = (output, context) => {
661
995
  return take(output, {
662
996
  'attachments': _json,
@@ -680,6 +1014,12 @@ const de_Message = (output, context) => {
680
1014
  'user': _json,
681
1015
  });
682
1016
  };
1017
+ const de_MessagesList = (output, context) => {
1018
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
1019
+ return de_Message(entry, context);
1020
+ });
1021
+ return retVal;
1022
+ };
683
1023
  const deserializeMetadata = (output) => ({
684
1024
  httpStatusCode: output.statusCode,
685
1025
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],