@wildix/xbees-conversations-client 1.0.21 → 1.0.22

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.
@@ -8,6 +8,7 @@ const DeleteChannelCommand_1 = require("./commands/DeleteChannelCommand");
8
8
  const GetChannelCommand_1 = require("./commands/GetChannelCommand");
9
9
  const GetChannelMemberCommand_1 = require("./commands/GetChannelMemberCommand");
10
10
  const GetMessageCommand_1 = require("./commands/GetMessageCommand");
11
+ const JoinChannelCommand_1 = require("./commands/JoinChannelCommand");
11
12
  const PartialUpdateChannelCommand_1 = require("./commands/PartialUpdateChannelCommand");
12
13
  const UpdateChannelCommand_1 = require("./commands/UpdateChannelCommand");
13
14
  const smithy_client_1 = require("@smithy/smithy-client");
@@ -18,6 +19,7 @@ const commands = {
18
19
  GetChannelCommand: GetChannelCommand_1.GetChannelCommand,
19
20
  GetChannelMemberCommand: GetChannelMemberCommand_1.GetChannelMemberCommand,
20
21
  GetMessageCommand: GetMessageCommand_1.GetMessageCommand,
22
+ JoinChannelCommand: JoinChannelCommand_1.JoinChannelCommand,
21
23
  PartialUpdateChannelCommand: PartialUpdateChannelCommand_1.PartialUpdateChannelCommand,
22
24
  UpdateChannelCommand: UpdateChannelCommand_1.UpdateChannelCommand,
23
25
  };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JoinChannelCommand = 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 JoinChannelCommand 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 = "ConversationsClient";
19
+ const commandName = "JoinChannelCommand";
20
+ const handlerExecutionContext = {
21
+ logger,
22
+ clientName,
23
+ commandName,
24
+ inputFilterSensitiveLog: (_) => _,
25
+ outputFilterSensitiveLog: (_) => _,
26
+ [types_1.SMITHY_CONTEXT_KEY]: {
27
+ service: "Conversations",
28
+ operation: "JoinChannel",
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_JoinChannelCommand)(input, context);
36
+ }
37
+ deserialize(output, context) {
38
+ return (0, Aws_restJson1_1.de_JoinChannelCommand)(output, context);
39
+ }
40
+ }
41
+ exports.JoinChannelCommand = JoinChannelCommand;
@@ -7,5 +7,6 @@ tslib_1.__exportStar(require("./DeleteChannelCommand"), exports);
7
7
  tslib_1.__exportStar(require("./GetChannelCommand"), exports);
8
8
  tslib_1.__exportStar(require("./GetChannelMemberCommand"), exports);
9
9
  tslib_1.__exportStar(require("./GetMessageCommand"), exports);
10
+ tslib_1.__exportStar(require("./JoinChannelCommand"), exports);
10
11
  tslib_1.__exportStar(require("./PartialUpdateChannelCommand"), exports);
11
12
  tslib_1.__exportStar(require("./UpdateChannelCommand"), exports);
@@ -1,7 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MemberNotFoundException = exports.MessageType = exports.MessageSmsStatus = exports.ChannelUnsetFields = exports.ChannelNotFoundException = exports.ChannelMemberRole = exports.ChannelContextSource = exports.ChannelContextEventAttendeeStatus = exports.ChannelAccess = exports.ChannelType = exports.ValidationException = void 0;
3
+ exports.MemberNotFoundException = exports.MessageType = exports.MessageSmsStatus = exports.ChannelUnsetFields = exports.ChannelNotFoundException = exports.ChannelMemberRole = exports.ChannelContextSource = exports.ChannelContextEventAttendeeStatus = exports.ChannelAccess = exports.ChannelType = exports.ValidationException = exports.ForbiddenException = void 0;
4
4
  const ConversationsServiceException_1 = require("./ConversationsServiceException");
5
+ class ForbiddenException extends ConversationsServiceException_1.ConversationsServiceException {
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;
5
18
  class ValidationException extends ConversationsServiceException_1.ConversationsServiceException {
6
19
  constructor(opts) {
7
20
  super({
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateChannelCommand = exports.de_PartialUpdateChannelCommand = exports.de_GetMessageCommand = exports.de_GetChannelMemberCommand = exports.de_GetChannelCommand = exports.de_DeleteChannelCommand = exports.de_CreateMessageCommand = exports.de_CreateChannelCommand = exports.se_UpdateChannelCommand = exports.se_PartialUpdateChannelCommand = exports.se_GetMessageCommand = exports.se_GetChannelMemberCommand = exports.se_GetChannelCommand = exports.se_DeleteChannelCommand = exports.se_CreateMessageCommand = exports.se_CreateChannelCommand = void 0;
3
+ exports.de_UpdateChannelCommand = exports.de_PartialUpdateChannelCommand = exports.de_JoinChannelCommand = exports.de_GetMessageCommand = exports.de_GetChannelMemberCommand = exports.de_GetChannelCommand = exports.de_DeleteChannelCommand = exports.de_CreateMessageCommand = exports.de_CreateChannelCommand = exports.se_UpdateChannelCommand = exports.se_PartialUpdateChannelCommand = exports.se_JoinChannelCommand = exports.se_GetMessageCommand = exports.se_GetChannelMemberCommand = exports.se_GetChannelCommand = exports.se_DeleteChannelCommand = exports.se_CreateMessageCommand = exports.se_CreateChannelCommand = void 0;
4
4
  const ConversationsServiceException_1 = require("../models/ConversationsServiceException");
5
5
  const models_0_1 = require("../models/models_0");
6
6
  const protocol_http_1 = require("@smithy/protocol-http");
@@ -10,7 +10,7 @@ const se_CreateChannelCommand = async (input, context) => {
10
10
  const headers = {
11
11
  'content-type': 'application/json',
12
12
  };
13
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations";
13
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels";
14
14
  let body;
15
15
  body = JSON.stringify((0, smithy_client_1.take)(input, {
16
16
  'channel': _ => (0, smithy_client_1._json)(_),
@@ -31,7 +31,7 @@ const se_CreateMessageCommand = async (input, context) => {
31
31
  const headers = {
32
32
  'content-type': 'application/json',
33
33
  };
34
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}/messages";
34
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages";
35
35
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
36
36
  const query = (0, smithy_client_1.map)({
37
37
  "user_id": [, (0, smithy_client_1.expectNonNull)(input.userId, `userId`)],
@@ -55,7 +55,7 @@ exports.se_CreateMessageCommand = se_CreateMessageCommand;
55
55
  const se_DeleteChannelCommand = async (input, context) => {
56
56
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
57
57
  const headers = {};
58
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}";
58
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}";
59
59
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
60
60
  let body;
61
61
  return new protocol_http_1.HttpRequest({
@@ -72,7 +72,7 @@ exports.se_DeleteChannelCommand = se_DeleteChannelCommand;
72
72
  const se_GetChannelCommand = async (input, context) => {
73
73
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
74
74
  const headers = {};
75
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}";
75
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}";
76
76
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
77
77
  let body;
78
78
  return new protocol_http_1.HttpRequest({
@@ -89,7 +89,7 @@ exports.se_GetChannelCommand = se_GetChannelCommand;
89
89
  const se_GetChannelMemberCommand = async (input, context) => {
90
90
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
91
91
  const headers = {};
92
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}/members/{memberId}";
92
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/members/{memberId}";
93
93
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
94
94
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'memberId', () => input.memberId, '{memberId}', false);
95
95
  let body;
@@ -107,7 +107,7 @@ exports.se_GetChannelMemberCommand = se_GetChannelMemberCommand;
107
107
  const se_GetMessageCommand = async (input, context) => {
108
108
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
109
109
  const headers = {};
110
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}/messages";
110
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages";
111
111
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
112
112
  let body;
113
113
  return new protocol_http_1.HttpRequest({
@@ -121,12 +121,29 @@ const se_GetMessageCommand = async (input, context) => {
121
121
  });
122
122
  };
123
123
  exports.se_GetMessageCommand = se_GetMessageCommand;
124
+ const se_JoinChannelCommand = async (input, context) => {
125
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
126
+ const headers = {};
127
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/join";
128
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
129
+ let body;
130
+ return new protocol_http_1.HttpRequest({
131
+ protocol,
132
+ hostname,
133
+ port,
134
+ method: "POST",
135
+ headers,
136
+ path: resolvedPath,
137
+ body,
138
+ });
139
+ };
140
+ exports.se_JoinChannelCommand = se_JoinChannelCommand;
124
141
  const se_PartialUpdateChannelCommand = async (input, context) => {
125
142
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
126
143
  const headers = {
127
144
  'content-type': 'application/json',
128
145
  };
129
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}";
146
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}";
130
147
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
131
148
  let body;
132
149
  body = JSON.stringify((0, smithy_client_1.take)(input, {
@@ -149,7 +166,7 @@ const se_UpdateChannelCommand = async (input, context) => {
149
166
  const headers = {
150
167
  'content-type': 'application/json',
151
168
  };
152
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}";
169
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}";
153
170
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
154
171
  let body;
155
172
  body = JSON.stringify((0, smithy_client_1.take)(input, {
@@ -188,6 +205,9 @@ const de_CreateChannelCommandError = async (output, context) => {
188
205
  };
189
206
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
190
207
  switch (errorCode) {
208
+ case "ForbiddenException":
209
+ case "smithy.framework#ForbiddenException":
210
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
191
211
  case "ValidationException":
192
212
  case "smithy.framework#ValidationException":
193
213
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -329,6 +349,9 @@ const de_GetChannelMemberCommandError = async (output, context) => {
329
349
  };
330
350
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
331
351
  switch (errorCode) {
352
+ case "ChannelNotFoundException":
353
+ case "wildix.xbees.conversations#ChannelNotFoundException":
354
+ throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
332
355
  case "MemberNotFoundException":
333
356
  case "wildix.xbees.conversations#MemberNotFoundException":
334
357
  throw await de_MemberNotFoundExceptionRes(parsedOutput, context);
@@ -381,6 +404,46 @@ const de_GetMessageCommandError = async (output, context) => {
381
404
  });
382
405
  }
383
406
  };
407
+ const de_JoinChannelCommand = async (output, context) => {
408
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
409
+ return de_JoinChannelCommandError(output, context);
410
+ }
411
+ const contents = (0, smithy_client_1.map)({
412
+ $metadata: deserializeMetadata(output),
413
+ });
414
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
415
+ const doc = (0, smithy_client_1.take)(data, {
416
+ 'channel': smithy_client_1._json,
417
+ });
418
+ Object.assign(contents, doc);
419
+ return contents;
420
+ };
421
+ exports.de_JoinChannelCommand = de_JoinChannelCommand;
422
+ const de_JoinChannelCommandError = async (output, context) => {
423
+ const parsedOutput = {
424
+ ...output,
425
+ body: await parseErrorBody(output.body, context)
426
+ };
427
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
428
+ switch (errorCode) {
429
+ case "ChannelNotFoundException":
430
+ case "wildix.xbees.conversations#ChannelNotFoundException":
431
+ throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
432
+ case "ForbiddenException":
433
+ case "smithy.framework#ForbiddenException":
434
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
435
+ case "ValidationException":
436
+ case "smithy.framework#ValidationException":
437
+ throw await de_ValidationExceptionRes(parsedOutput, context);
438
+ default:
439
+ const parsedBody = parsedOutput.body;
440
+ return throwDefaultError({
441
+ output,
442
+ parsedBody,
443
+ errorCode
444
+ });
445
+ }
446
+ };
384
447
  const de_PartialUpdateChannelCommand = async (output, context) => {
385
448
  if (output.statusCode !== 200 && output.statusCode >= 300) {
386
449
  return de_PartialUpdateChannelCommandError(output, context);
@@ -403,6 +466,9 @@ const de_PartialUpdateChannelCommandError = async (output, context) => {
403
466
  };
404
467
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
405
468
  switch (errorCode) {
469
+ case "ChannelNotFoundException":
470
+ case "wildix.xbees.conversations#ChannelNotFoundException":
471
+ throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
406
472
  case "ValidationException":
407
473
  case "smithy.framework#ValidationException":
408
474
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -437,6 +503,9 @@ const de_UpdateChannelCommandError = async (output, context) => {
437
503
  };
438
504
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
439
505
  switch (errorCode) {
506
+ case "ChannelNotFoundException":
507
+ case "wildix.xbees.conversations#ChannelNotFoundException":
508
+ throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
440
509
  case "ValidationException":
441
510
  case "smithy.framework#ValidationException":
442
511
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -450,10 +519,25 @@ const de_UpdateChannelCommandError = async (output, context) => {
450
519
  }
451
520
  };
452
521
  const throwDefaultError = (0, smithy_client_1.withBaseException)(ConversationsServiceException_1.ConversationsServiceException);
522
+ const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
523
+ const contents = (0, smithy_client_1.map)({});
524
+ const data = parsedOutput.body;
525
+ const doc = (0, smithy_client_1.take)(data, {
526
+ 'message': smithy_client_1.expectString,
527
+ });
528
+ Object.assign(contents, doc);
529
+ const exception = new models_0_1.ForbiddenException({
530
+ $metadata: deserializeMetadata(parsedOutput),
531
+ ...contents
532
+ });
533
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
534
+ };
453
535
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
454
536
  const contents = (0, smithy_client_1.map)({});
455
537
  const data = parsedOutput.body;
456
- const doc = (0, smithy_client_1.take)(data, {});
538
+ const doc = (0, smithy_client_1.take)(data, {
539
+ 'message': smithy_client_1.expectString,
540
+ });
457
541
  Object.assign(contents, doc);
458
542
  const exception = new models_0_1.ValidationException({
459
543
  $metadata: deserializeMetadata(parsedOutput),
@@ -5,6 +5,7 @@ import { DeleteChannelCommand, } from "./commands/DeleteChannelCommand";
5
5
  import { GetChannelCommand, } from "./commands/GetChannelCommand";
6
6
  import { GetChannelMemberCommand, } from "./commands/GetChannelMemberCommand";
7
7
  import { GetMessageCommand, } from "./commands/GetMessageCommand";
8
+ import { JoinChannelCommand, } from "./commands/JoinChannelCommand";
8
9
  import { PartialUpdateChannelCommand, } from "./commands/PartialUpdateChannelCommand";
9
10
  import { UpdateChannelCommand, } from "./commands/UpdateChannelCommand";
10
11
  import { createAggregatedClient } from "@smithy/smithy-client";
@@ -15,6 +16,7 @@ const commands = {
15
16
  GetChannelCommand,
16
17
  GetChannelMemberCommand,
17
18
  GetMessageCommand,
19
+ JoinChannelCommand,
18
20
  PartialUpdateChannelCommand,
19
21
  UpdateChannelCommand,
20
22
  };
@@ -0,0 +1,37 @@
1
+ import { de_JoinChannelCommand, se_JoinChannelCommand, } 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 JoinChannelCommand 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 = "JoinChannelCommand";
17
+ const handlerExecutionContext = {
18
+ logger,
19
+ clientName,
20
+ commandName,
21
+ inputFilterSensitiveLog: (_) => _,
22
+ outputFilterSensitiveLog: (_) => _,
23
+ [SMITHY_CONTEXT_KEY]: {
24
+ service: "Conversations",
25
+ operation: "JoinChannel",
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_JoinChannelCommand(input, context);
33
+ }
34
+ deserialize(output, context) {
35
+ return de_JoinChannelCommand(output, context);
36
+ }
37
+ }
@@ -4,5 +4,6 @@ export * from "./DeleteChannelCommand";
4
4
  export * from "./GetChannelCommand";
5
5
  export * from "./GetChannelMemberCommand";
6
6
  export * from "./GetMessageCommand";
7
+ export * from "./JoinChannelCommand";
7
8
  export * from "./PartialUpdateChannelCommand";
8
9
  export * from "./UpdateChannelCommand";
@@ -1,4 +1,16 @@
1
1
  import { ConversationsServiceException as __BaseException } from "./ConversationsServiceException";
2
+ export class ForbiddenException extends __BaseException {
3
+ constructor(opts) {
4
+ super({
5
+ name: "ForbiddenException",
6
+ $fault: "client",
7
+ ...opts
8
+ });
9
+ this.name = "ForbiddenException";
10
+ this.$fault = "client";
11
+ Object.setPrototypeOf(this, ForbiddenException.prototype);
12
+ }
13
+ }
2
14
  export class ValidationException extends __BaseException {
3
15
  constructor(opts) {
4
16
  super({
@@ -1,5 +1,5 @@
1
1
  import { ConversationsServiceException as __BaseException } from "../models/ConversationsServiceException";
2
- import { ChannelNotFoundException, MemberNotFoundException, ValidationException, } from "../models/models_0";
2
+ import { ChannelNotFoundException, ForbiddenException, MemberNotFoundException, 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) => {
@@ -7,7 +7,7 @@ export const se_CreateChannelCommand = async (input, context) => {
7
7
  const headers = {
8
8
  'content-type': 'application/json',
9
9
  };
10
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations";
10
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels";
11
11
  let body;
12
12
  body = JSON.stringify(take(input, {
13
13
  'channel': _ => _json(_),
@@ -27,7 +27,7 @@ export const se_CreateMessageCommand = async (input, context) => {
27
27
  const headers = {
28
28
  'content-type': 'application/json',
29
29
  };
30
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}/messages";
30
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages";
31
31
  resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
32
32
  const query = map({
33
33
  "user_id": [, __expectNonNull(input.userId, `userId`)],
@@ -50,7 +50,7 @@ export const se_CreateMessageCommand = async (input, context) => {
50
50
  export const se_DeleteChannelCommand = async (input, context) => {
51
51
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
52
52
  const headers = {};
53
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}";
53
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}";
54
54
  resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
55
55
  let body;
56
56
  return new __HttpRequest({
@@ -66,7 +66,7 @@ export const se_DeleteChannelCommand = async (input, context) => {
66
66
  export const se_GetChannelCommand = async (input, context) => {
67
67
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
68
68
  const headers = {};
69
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}";
69
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}";
70
70
  resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
71
71
  let body;
72
72
  return new __HttpRequest({
@@ -82,7 +82,7 @@ export const se_GetChannelCommand = async (input, context) => {
82
82
  export const se_GetChannelMemberCommand = async (input, context) => {
83
83
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
84
84
  const headers = {};
85
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}/members/{memberId}";
85
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/members/{memberId}";
86
86
  resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
87
87
  resolvedPath = __resolvedPath(resolvedPath, input, 'memberId', () => input.memberId, '{memberId}', false);
88
88
  let body;
@@ -99,7 +99,7 @@ export const se_GetChannelMemberCommand = async (input, context) => {
99
99
  export const se_GetMessageCommand = async (input, context) => {
100
100
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
101
101
  const headers = {};
102
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}/messages";
102
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/messages";
103
103
  resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
104
104
  let body;
105
105
  return new __HttpRequest({
@@ -112,12 +112,28 @@ export const se_GetMessageCommand = async (input, context) => {
112
112
  body,
113
113
  });
114
114
  };
115
+ export const se_JoinChannelCommand = async (input, context) => {
116
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
117
+ const headers = {};
118
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}/join";
119
+ resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
120
+ let body;
121
+ return new __HttpRequest({
122
+ protocol,
123
+ hostname,
124
+ port,
125
+ method: "POST",
126
+ headers,
127
+ path: resolvedPath,
128
+ body,
129
+ });
130
+ };
115
131
  export const se_PartialUpdateChannelCommand = async (input, context) => {
116
132
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
117
133
  const headers = {
118
134
  'content-type': 'application/json',
119
135
  };
120
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}";
136
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}";
121
137
  resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
122
138
  let body;
123
139
  body = JSON.stringify(take(input, {
@@ -139,7 +155,7 @@ export const se_UpdateChannelCommand = async (input, context) => {
139
155
  const headers = {
140
156
  'content-type': 'application/json',
141
157
  };
142
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/{channelId}";
158
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/conversations/channels/{channelId}";
143
159
  resolvedPath = __resolvedPath(resolvedPath, input, 'channelId', () => input.channelId, '{channelId}', false);
144
160
  let body;
145
161
  body = JSON.stringify(take(input, {
@@ -176,6 +192,9 @@ const de_CreateChannelCommandError = async (output, context) => {
176
192
  };
177
193
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
178
194
  switch (errorCode) {
195
+ case "ForbiddenException":
196
+ case "smithy.framework#ForbiddenException":
197
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
179
198
  case "ValidationException":
180
199
  case "smithy.framework#ValidationException":
181
200
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -313,6 +332,9 @@ const de_GetChannelMemberCommandError = async (output, context) => {
313
332
  };
314
333
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
315
334
  switch (errorCode) {
335
+ case "ChannelNotFoundException":
336
+ case "wildix.xbees.conversations#ChannelNotFoundException":
337
+ throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
316
338
  case "MemberNotFoundException":
317
339
  case "wildix.xbees.conversations#MemberNotFoundException":
318
340
  throw await de_MemberNotFoundExceptionRes(parsedOutput, context);
@@ -364,6 +386,45 @@ const de_GetMessageCommandError = async (output, context) => {
364
386
  });
365
387
  }
366
388
  };
389
+ export const de_JoinChannelCommand = async (output, context) => {
390
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
391
+ return de_JoinChannelCommandError(output, context);
392
+ }
393
+ const contents = map({
394
+ $metadata: deserializeMetadata(output),
395
+ });
396
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
397
+ const doc = take(data, {
398
+ 'channel': _json,
399
+ });
400
+ Object.assign(contents, doc);
401
+ return contents;
402
+ };
403
+ const de_JoinChannelCommandError = async (output, context) => {
404
+ const parsedOutput = {
405
+ ...output,
406
+ body: await parseErrorBody(output.body, context)
407
+ };
408
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
409
+ switch (errorCode) {
410
+ case "ChannelNotFoundException":
411
+ case "wildix.xbees.conversations#ChannelNotFoundException":
412
+ throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
413
+ case "ForbiddenException":
414
+ case "smithy.framework#ForbiddenException":
415
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
416
+ case "ValidationException":
417
+ case "smithy.framework#ValidationException":
418
+ throw await de_ValidationExceptionRes(parsedOutput, context);
419
+ default:
420
+ const parsedBody = parsedOutput.body;
421
+ return throwDefaultError({
422
+ output,
423
+ parsedBody,
424
+ errorCode
425
+ });
426
+ }
427
+ };
367
428
  export const de_PartialUpdateChannelCommand = async (output, context) => {
368
429
  if (output.statusCode !== 200 && output.statusCode >= 300) {
369
430
  return de_PartialUpdateChannelCommandError(output, context);
@@ -385,6 +446,9 @@ const de_PartialUpdateChannelCommandError = async (output, context) => {
385
446
  };
386
447
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
387
448
  switch (errorCode) {
449
+ case "ChannelNotFoundException":
450
+ case "wildix.xbees.conversations#ChannelNotFoundException":
451
+ throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
388
452
  case "ValidationException":
389
453
  case "smithy.framework#ValidationException":
390
454
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -418,6 +482,9 @@ const de_UpdateChannelCommandError = async (output, context) => {
418
482
  };
419
483
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
420
484
  switch (errorCode) {
485
+ case "ChannelNotFoundException":
486
+ case "wildix.xbees.conversations#ChannelNotFoundException":
487
+ throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
421
488
  case "ValidationException":
422
489
  case "smithy.framework#ValidationException":
423
490
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -431,10 +498,25 @@ const de_UpdateChannelCommandError = async (output, context) => {
431
498
  }
432
499
  };
433
500
  const throwDefaultError = withBaseException(__BaseException);
501
+ const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
502
+ const contents = map({});
503
+ const data = parsedOutput.body;
504
+ const doc = take(data, {
505
+ 'message': __expectString,
506
+ });
507
+ Object.assign(contents, doc);
508
+ const exception = new ForbiddenException({
509
+ $metadata: deserializeMetadata(parsedOutput),
510
+ ...contents
511
+ });
512
+ return __decorateServiceException(exception, parsedOutput.body);
513
+ };
434
514
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
435
515
  const contents = map({});
436
516
  const data = parsedOutput.body;
437
- const doc = take(data, {});
517
+ const doc = take(data, {
518
+ 'message': __expectString,
519
+ });
438
520
  Object.assign(contents, doc);
439
521
  const exception = new ValidationException({
440
522
  $metadata: deserializeMetadata(parsedOutput),
@@ -5,6 +5,7 @@ import { DeleteChannelCommandInput, DeleteChannelCommandOutput } from "./command
5
5
  import { GetChannelCommandInput, GetChannelCommandOutput } from "./commands/GetChannelCommand";
6
6
  import { GetChannelMemberCommandInput, GetChannelMemberCommandOutput } from "./commands/GetChannelMemberCommand";
7
7
  import { GetMessageCommandInput, GetMessageCommandOutput } from "./commands/GetMessageCommand";
8
+ import { JoinChannelCommandInput, JoinChannelCommandOutput } from "./commands/JoinChannelCommand";
8
9
  import { PartialUpdateChannelCommandInput, PartialUpdateChannelCommandOutput } from "./commands/PartialUpdateChannelCommand";
9
10
  import { UpdateChannelCommandInput, UpdateChannelCommandOutput } from "./commands/UpdateChannelCommand";
10
11
  import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
@@ -45,6 +46,12 @@ export interface Conversations {
45
46
  getMessage(args: GetMessageCommandInput, options?: __HttpHandlerOptions): Promise<GetMessageCommandOutput>;
46
47
  getMessage(args: GetMessageCommandInput, cb: (err: any, data?: GetMessageCommandOutput) => void): void;
47
48
  getMessage(args: GetMessageCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetMessageCommandOutput) => void): void;
49
+ /**
50
+ * @see {@link JoinChannelCommand}
51
+ */
52
+ joinChannel(args: JoinChannelCommandInput, options?: __HttpHandlerOptions): Promise<JoinChannelCommandOutput>;
53
+ joinChannel(args: JoinChannelCommandInput, cb: (err: any, data?: JoinChannelCommandOutput) => void): void;
54
+ joinChannel(args: JoinChannelCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: JoinChannelCommandOutput) => void): void;
48
55
  /**
49
56
  * @see {@link PartialUpdateChannelCommand}
50
57
  */
@@ -4,6 +4,7 @@ import { DeleteChannelCommandInput, DeleteChannelCommandOutput } from "./command
4
4
  import { GetChannelCommandInput, GetChannelCommandOutput } from "./commands/GetChannelCommand";
5
5
  import { GetChannelMemberCommandInput, GetChannelMemberCommandOutput } from "./commands/GetChannelMemberCommand";
6
6
  import { GetMessageCommandInput, GetMessageCommandOutput } from "./commands/GetMessageCommand";
7
+ import { JoinChannelCommandInput, JoinChannelCommandOutput } from "./commands/JoinChannelCommand";
7
8
  import { PartialUpdateChannelCommandInput, PartialUpdateChannelCommandOutput } from "./commands/PartialUpdateChannelCommand";
8
9
  import { UpdateChannelCommandInput, UpdateChannelCommandOutput } from "./commands/UpdateChannelCommand";
9
10
  import { RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";
@@ -15,11 +16,11 @@ export { __Client };
15
16
  /**
16
17
  * @public
17
18
  */
18
- export type ServiceInputTypes = CreateChannelCommandInput | CreateMessageCommandInput | DeleteChannelCommandInput | GetChannelCommandInput | GetChannelMemberCommandInput | GetMessageCommandInput | PartialUpdateChannelCommandInput | UpdateChannelCommandInput;
19
+ export type ServiceInputTypes = CreateChannelCommandInput | CreateMessageCommandInput | DeleteChannelCommandInput | GetChannelCommandInput | GetChannelMemberCommandInput | GetMessageCommandInput | JoinChannelCommandInput | PartialUpdateChannelCommandInput | UpdateChannelCommandInput;
19
20
  /**
20
21
  * @public
21
22
  */
22
- export type ServiceOutputTypes = CreateChannelCommandOutput | CreateMessageCommandOutput | DeleteChannelCommandOutput | GetChannelCommandOutput | GetChannelMemberCommandOutput | GetMessageCommandOutput | PartialUpdateChannelCommandOutput | UpdateChannelCommandOutput;
23
+ export type ServiceOutputTypes = CreateChannelCommandOutput | CreateMessageCommandOutput | DeleteChannelCommandOutput | GetChannelCommandOutput | GetChannelMemberCommandOutput | GetMessageCommandOutput | JoinChannelCommandOutput | PartialUpdateChannelCommandOutput | UpdateChannelCommandOutput;
23
24
  /**
24
25
  * @public
25
26
  */
@@ -167,6 +167,8 @@ export interface CreateChannelCommandOutput extends CreateChannelOutput, __Metad
167
167
  * @see {@link CreateChannelCommandOutput} for command's `response` shape.
168
168
  * @see {@link ConversationsClientResolvedConfig | config} for ConversationsClient's `config` shape.
169
169
  *
170
+ * @throws {@link ForbiddenException} (client fault)
171
+ *
170
172
  * @throws {@link ValidationException} (client fault)
171
173
  *
172
174
  * @throws {@link ConversationsServiceException}
@@ -51,6 +51,8 @@ export interface GetChannelMemberCommandOutput extends GetChannelMemberOutput, _
51
51
  * @see {@link GetChannelMemberCommandOutput} for command's `response` shape.
52
52
  * @see {@link ConversationsClientResolvedConfig | config} for ConversationsClient's `config` shape.
53
53
  *
54
+ * @throws {@link ChannelNotFoundException} (client fault)
55
+ *
54
56
  * @throws {@link MemberNotFoundException} (client fault)
55
57
  *
56
58
  * @throws {@link ValidationException} (client fault)
@@ -0,0 +1,138 @@
1
+ import { ConversationsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConversationsClient";
2
+ import { JoinChannelInput, JoinChannelOutput } from "../models/models_0";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer } from "@smithy/types";
5
+ /**
6
+ * @public
7
+ */
8
+ export { __MetadataBearer, $Command };
9
+ /**
10
+ * @public
11
+ *
12
+ * The input for {@link JoinChannelCommand}.
13
+ */
14
+ export interface JoinChannelCommandInput extends JoinChannelInput {
15
+ }
16
+ /**
17
+ * @public
18
+ *
19
+ * The output of {@link JoinChannelCommand}.
20
+ */
21
+ export interface JoinChannelCommandOutput extends JoinChannelOutput, __MetadataBearer {
22
+ }
23
+ /**
24
+ * @public
25
+ *
26
+ * @example
27
+ * Use a bare-bones client and the command you need to make an API call.
28
+ * ```javascript
29
+ * import { ConversationsClient, JoinChannelCommand } from "@wildix/xbees-conversations-client"; // ES Modules import
30
+ * // const { ConversationsClient, JoinChannelCommand } = require("@wildix/xbees-conversations-client"); // CommonJS import
31
+ * const client = new ConversationsClient(config);
32
+ * const input = { // JoinChannelInput
33
+ * channelId: "STRING_VALUE", // required
34
+ * };
35
+ * const command = new JoinChannelCommand(input);
36
+ * const response = await client.send(command);
37
+ * // { // JoinChannelOutput
38
+ * // channel: { // Channel
39
+ * // subject: "STRING_VALUE",
40
+ * // description: "STRING_VALUE",
41
+ * // picture: "STRING_VALUE",
42
+ * // pictureColor: "STRING_VALUE",
43
+ * // access: "private" || "public",
44
+ * // company: "STRING_VALUE",
45
+ * // context: { // ChannelContext
46
+ * // source: "kite",
47
+ * // target: "STRING_VALUE",
48
+ * // events: [ // ChannelContextEventList
49
+ * // { // ChannelContextEvent
50
+ * // id: "STRING_VALUE",
51
+ * // owner: "STRING_VALUE",
52
+ * // start: "STRING_VALUE",
53
+ * // end: "STRING_VALUE",
54
+ * // summary: "STRING_VALUE",
55
+ * // attendees: [ // ChannelContextEventAttendeeList
56
+ * // { // ChannelContextEventAttendee
57
+ * // email: "STRING_VALUE", // required
58
+ * // name: "STRING_VALUE",
59
+ * // status: "accepted" || "tentative" || "declined" || "none", // required
60
+ * // },
61
+ * // ],
62
+ * // },
63
+ * // ],
64
+ * // },
65
+ * // kite: true || false,
66
+ * // kiteTarget: "STRING_VALUE",
67
+ * // kiteVariant: "STRING_VALUE",
68
+ * // kiteAssign: "STRING_VALUE",
69
+ * // kiteServiceName: "STRING_VALUE",
70
+ * // kiteDefaultSubject: "STRING_VALUE",
71
+ * // service: "STRING_VALUE",
72
+ * // serviceTitle: "STRING_VALUE",
73
+ * // serviceRecipient: "STRING_VALUE",
74
+ * // assignee: { // User
75
+ * // id: "STRING_VALUE", // required
76
+ * // name: "STRING_VALUE",
77
+ * // email: "STRING_VALUE",
78
+ * // phone: "STRING_VALUE",
79
+ * // picture: "STRING_VALUE",
80
+ * // company: "STRING_VALUE",
81
+ * // pbxDomain: "STRING_VALUE",
82
+ * // pbxPort: "STRING_VALUE",
83
+ * // pbxExtension: "STRING_VALUE",
84
+ * // pbxSerial: "STRING_VALUE",
85
+ * // pbxUserId: "STRING_VALUE",
86
+ * // createdAt: "STRING_VALUE",
87
+ * // updatedAt: "STRING_VALUE",
88
+ * // },
89
+ * // telephony: true || false,
90
+ * // sms: true || false,
91
+ * // broadcast: true || false,
92
+ * // external: true || false,
93
+ * // channelId: "STRING_VALUE", // required
94
+ * // channelType: "direct" || "group", // required
95
+ * // memberCount: Number("int"), // required
96
+ * // createdAt: "STRING_VALUE", // required
97
+ * // createdBy: "STRING_VALUE", // required
98
+ * // updatedAt: "STRING_VALUE",
99
+ * // },
100
+ * // };
101
+ *
102
+ * ```
103
+ *
104
+ * @param JoinChannelCommandInput - {@link JoinChannelCommandInput}
105
+ * @returns {@link JoinChannelCommandOutput}
106
+ * @see {@link JoinChannelCommandInput} for command's `input` shape.
107
+ * @see {@link JoinChannelCommandOutput} for command's `response` shape.
108
+ * @see {@link ConversationsClientResolvedConfig | config} for ConversationsClient's `config` shape.
109
+ *
110
+ * @throws {@link ChannelNotFoundException} (client fault)
111
+ *
112
+ * @throws {@link ForbiddenException} (client fault)
113
+ *
114
+ * @throws {@link ValidationException} (client fault)
115
+ *
116
+ * @throws {@link ConversationsServiceException}
117
+ * <p>Base exception class for all service exceptions from Conversations service.</p>
118
+ *
119
+ */
120
+ export declare class JoinChannelCommand extends $Command<JoinChannelCommandInput, JoinChannelCommandOutput, ConversationsClientResolvedConfig> {
121
+ readonly input: JoinChannelCommandInput;
122
+ /**
123
+ * @public
124
+ */
125
+ constructor(input: JoinChannelCommandInput);
126
+ /**
127
+ * @internal
128
+ */
129
+ resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: ConversationsClientResolvedConfig, options?: __HttpHandlerOptions): Handler<JoinChannelCommandInput, JoinChannelCommandOutput>;
130
+ /**
131
+ * @internal
132
+ */
133
+ private serialize;
134
+ /**
135
+ * @internal
136
+ */
137
+ private deserialize;
138
+ }
@@ -166,6 +166,8 @@ export interface PartialUpdateChannelCommandOutput extends PartialUpdateChannelO
166
166
  * @see {@link PartialUpdateChannelCommandOutput} for command's `response` shape.
167
167
  * @see {@link ConversationsClientResolvedConfig | config} for ConversationsClient's `config` shape.
168
168
  *
169
+ * @throws {@link ChannelNotFoundException} (client fault)
170
+ *
169
171
  * @throws {@link ValidationException} (client fault)
170
172
  *
171
173
  * @throws {@link ConversationsServiceException}
@@ -163,6 +163,8 @@ export interface UpdateChannelCommandOutput extends UpdateChannelOutput, __Metad
163
163
  * @see {@link UpdateChannelCommandOutput} for command's `response` shape.
164
164
  * @see {@link ConversationsClientResolvedConfig | config} for ConversationsClient's `config` shape.
165
165
  *
166
+ * @throws {@link ChannelNotFoundException} (client fault)
167
+ *
166
168
  * @throws {@link ValidationException} (client fault)
167
169
  *
168
170
  * @throws {@link ConversationsServiceException}
@@ -4,5 +4,6 @@ export * from "./DeleteChannelCommand";
4
4
  export * from "./GetChannelCommand";
5
5
  export * from "./GetChannelMemberCommand";
6
6
  export * from "./GetMessageCommand";
7
+ export * from "./JoinChannelCommand";
7
8
  export * from "./PartialUpdateChannelCommand";
8
9
  export * from "./UpdateChannelCommand";
@@ -3,26 +3,25 @@ import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-cli
3
3
  /**
4
4
  * @public
5
5
  */
6
- export declare class ValidationException extends __BaseException {
7
- readonly name: "ValidationException";
6
+ export declare class ForbiddenException extends __BaseException {
7
+ readonly name: "ForbiddenException";
8
8
  readonly $fault: "client";
9
9
  /**
10
10
  * @internal
11
11
  */
12
- constructor(opts: __ExceptionOptionType<ValidationException, __BaseException>);
12
+ constructor(opts: __ExceptionOptionType<ForbiddenException, __BaseException>);
13
13
  }
14
- /**
15
- * @public
16
- * @enum
17
- */
18
- export declare const ChannelType: {
19
- readonly DIRECT: "direct";
20
- readonly GROUP: "group";
21
- };
22
14
  /**
23
15
  * @public
24
16
  */
25
- export type ChannelType = typeof ChannelType[keyof typeof ChannelType];
17
+ export declare class ValidationException extends __BaseException {
18
+ readonly name: "ValidationException";
19
+ readonly $fault: "client";
20
+ /**
21
+ * @internal
22
+ */
23
+ constructor(opts: __ExceptionOptionType<ValidationException, __BaseException>);
24
+ }
26
25
  /**
27
26
  * @public
28
27
  */
@@ -41,6 +40,18 @@ export interface User {
41
40
  createdAt?: string;
42
41
  updatedAt?: string;
43
42
  }
43
+ /**
44
+ * @public
45
+ * @enum
46
+ */
47
+ export declare const ChannelType: {
48
+ readonly DIRECT: "direct";
49
+ readonly GROUP: "group";
50
+ };
51
+ /**
52
+ * @public
53
+ */
54
+ export type ChannelType = typeof ChannelType[keyof typeof ChannelType];
44
55
  /**
45
56
  * @public
46
57
  * @enum
@@ -413,6 +424,18 @@ export declare class MemberNotFoundException extends __BaseException {
413
424
  export interface GetMessageInput {
414
425
  channelId: string;
415
426
  }
427
+ /**
428
+ * @public
429
+ */
430
+ export interface JoinChannelInput {
431
+ channelId: string;
432
+ }
433
+ /**
434
+ * @public
435
+ */
436
+ export interface JoinChannelOutput {
437
+ channel: Channel;
438
+ }
416
439
  /**
417
440
  * @public
418
441
  */
@@ -4,6 +4,7 @@ import { DeleteChannelCommandInput, DeleteChannelCommandOutput } from "../comman
4
4
  import { GetChannelCommandInput, GetChannelCommandOutput } from "../commands/GetChannelCommand";
5
5
  import { GetChannelMemberCommandInput, GetChannelMemberCommandOutput } from "../commands/GetChannelMemberCommand";
6
6
  import { GetMessageCommandInput, GetMessageCommandOutput } from "../commands/GetMessageCommand";
7
+ import { JoinChannelCommandInput, JoinChannelCommandOutput } from "../commands/JoinChannelCommand";
7
8
  import { PartialUpdateChannelCommandInput, PartialUpdateChannelCommandOutput } from "../commands/PartialUpdateChannelCommand";
8
9
  import { UpdateChannelCommandInput, UpdateChannelCommandOutput } from "../commands/UpdateChannelCommand";
9
10
  import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
@@ -32,6 +33,10 @@ export declare const se_GetChannelMemberCommand: (input: GetChannelMemberCommand
32
33
  * serializeAws_restJson1GetMessageCommand
33
34
  */
34
35
  export declare const se_GetMessageCommand: (input: GetMessageCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
36
+ /**
37
+ * serializeAws_restJson1JoinChannelCommand
38
+ */
39
+ export declare const se_JoinChannelCommand: (input: JoinChannelCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
35
40
  /**
36
41
  * serializeAws_restJson1PartialUpdateChannelCommand
37
42
  */
@@ -64,6 +69,10 @@ export declare const de_GetChannelMemberCommand: (output: __HttpResponse, contex
64
69
  * deserializeAws_restJson1GetMessageCommand
65
70
  */
66
71
  export declare const de_GetMessageCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetMessageCommandOutput>;
72
+ /**
73
+ * deserializeAws_restJson1JoinChannelCommand
74
+ */
75
+ export declare const de_JoinChannelCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<JoinChannelCommandOutput>;
67
76
  /**
68
77
  * deserializeAws_restJson1PartialUpdateChannelCommand
69
78
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/xbees-conversations-client",
3
3
  "description": "@wildix/xbees-conversations-client client",
4
- "version": "1.0.21",
4
+ "version": "1.0.22",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",