Skip to content

Commit a9169d3

Browse files
author
awstools
committedJun 22, 2023
feat(client-chime-sdk-messaging): ChannelMessages can be made visible to sender and intended recipient rather than all channel members with the target attribute. For example, a user can send messages to a bot and receive messages back in a group channel without other members seeing them.
1 parent 7c50810 commit a9169d3

16 files changed

+183
-53
lines changed
 

‎clients/client-chime-sdk-messaging/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
AWS SDK for JavaScript ChimeSDKMessaging Client for Node.js, Browser and React Native.
88

9-
<p>The Amazon Chime SDK Messaging APIs in this section allow software developers to send
9+
<p>The Amazon Chime SDK messaging APIs in this section allow software developers to send
1010
and receive messages in custom messaging applications. These APIs depend on the frameworks
11-
provided by the Amazon Chime SDK Identity APIs. For more information about the messaging
11+
provided by the Amazon Chime SDK identity APIs. For more information about the messaging
1212
APIs, see <a href="https://docs.aws.amazon.com/chime/latest/APIReference/API_Operations_Amazon_Chime_SDK_Messaging.html">Amazon Chime SDK messaging</a>.</p>
1313

1414
## Installing

‎clients/client-chime-sdk-messaging/src/ChimeSDKMessaging.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1132,9 +1132,9 @@ export interface ChimeSDKMessaging {
11321132

11331133
/**
11341134
* @public
1135-
* <p>The Amazon Chime SDK Messaging APIs in this section allow software developers to send
1135+
* <p>The Amazon Chime SDK messaging APIs in this section allow software developers to send
11361136
* and receive messages in custom messaging applications. These APIs depend on the frameworks
1137-
* provided by the Amazon Chime SDK Identity APIs. For more information about the messaging
1137+
* provided by the Amazon Chime SDK identity APIs. For more information about the messaging
11381138
* APIs, see <a href="https://docs.aws.amazon.com/chime/latest/APIReference/API_Operations_Amazon_Chime_SDK_Messaging.html">Amazon Chime SDK messaging</a>.</p>
11391139
*/
11401140
export class ChimeSDKMessaging extends ChimeSDKMessagingClient implements ChimeSDKMessaging {}

‎clients/client-chime-sdk-messaging/src/ChimeSDKMessagingClient.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,9 @@ export interface ChimeSDKMessagingClientResolvedConfig extends ChimeSDKMessaging
484484

485485
/**
486486
* @public
487-
* <p>The Amazon Chime SDK Messaging APIs in this section allow software developers to send
487+
* <p>The Amazon Chime SDK messaging APIs in this section allow software developers to send
488488
* and receive messages in custom messaging applications. These APIs depend on the frameworks
489-
* provided by the Amazon Chime SDK Identity APIs. For more information about the messaging
489+
* provided by the Amazon Chime SDK identity APIs. For more information about the messaging
490490
* APIs, see <a href="https://docs.aws.amazon.com/chime/latest/APIReference/API_Operations_Amazon_Chime_SDK_Messaging.html">Amazon Chime SDK messaging</a>.</p>
491491
*/
492492
export class ChimeSDKMessagingClient extends __Client<

‎clients/client-chime-sdk-messaging/src/commands/ChannelFlowCallbackCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export interface ChannelFlowCallbackCommandOutput extends ChannelFlowCallbackRes
4444

4545
/**
4646
* @public
47-
* <p>Calls back Chime SDK Messaging with a processing response message. This should be invoked from the processor Lambda. This is a developer API.</p>
47+
* <p>Calls back Amazon Chime SDK messaging with a processing response message. This should be invoked from the processor Lambda. This is a developer API.</p>
4848
* <p>You can return one of the following processing responses:</p>
4949
* <ul>
5050
* <li>

‎clients/client-chime-sdk-messaging/src/commands/CreateChannelFlowCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export interface CreateChannelFlowCommandOutput extends CreateChannelFlowRespons
6161
* </li>
6262
* </ol>
6363
* <note>
64-
* <p>Channel flows don't process Control or System messages. For more information about the message types provided by Chime SDK Messaging, refer to
64+
* <p>Channel flows don't process Control or System messages. For more information about the message types provided by Chime SDK messaging, refer to
6565
* <a href="https://docs.aws.amazon.com/chime/latest/dg/using-the-messaging-sdk.html#msg-types">Message types</a> in the <i>Amazon Chime developer guide</i>.</p>
6666
* </note>
6767
* @example

‎clients/client-chime-sdk-messaging/src/commands/GetChannelMembershipPreferencesCommand.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ export interface GetChannelMembershipPreferencesCommandOutput
5050
/**
5151
* @public
5252
* <p>Gets the membership preferences of an <code>AppInstanceUser</code> or <code>AppInstanceBot</code>
53-
* for the specified channel. A user or a bot must be a member of the channel and own the membership to be able
54-
* to retrieve membership preferences. Users or bots in the <code>AppInstanceAdmin</code> and channel moderator roles can't
53+
* for the specified channel. A user or a bot must be a member of the channel and own the membership in order to retrieve membership preferences.
54+
* Users or bots in the <code>AppInstanceAdmin</code> and channel moderator roles can't
5555
* retrieve preferences for other users or bots. Banned users or bots can't retrieve membership preferences for the
5656
* channel from which they are banned.</p>
5757
* <note>

‎clients/client-chime-sdk-messaging/src/commands/GetChannelMessageCommand.ts

+5
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ export interface GetChannelMessageCommandOutput extends GetChannelMessageRespons
9393
* // },
9494
* // SubChannelId: "STRING_VALUE",
9595
* // ContentType: "STRING_VALUE",
96+
* // Target: [ // TargetList
97+
* // { // Target
98+
* // MemberArn: "STRING_VALUE",
99+
* // },
100+
* // ],
96101
* // },
97102
* // };
98103
*

‎clients/client-chime-sdk-messaging/src/commands/GetChannelMessageStatusCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export interface GetChannelMessageStatusCommandOutput extends GetChannelMessageS
5858
* </dd>
5959
* <dt>DENIED</dt>
6060
* <dd>
61-
* <p>Messasge denied by the processor</p>
61+
* <p>Message denied by the processor</p>
6262
* </dd>
6363
* </dl>
6464
* <note>

‎clients/client-chime-sdk-messaging/src/commands/ListChannelMembershipsForAppInstanceUserCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export interface ListChannelMembershipsForAppInstanceUserCommandOutput
5151

5252
/**
5353
* @public
54-
* <p> Lists all channels that anr <code>AppInstanceUser</code> or <code>AppInstanceBot</code> is a part of.
54+
* <p> Lists all channels that an <code>AppInstanceUser</code> or <code>AppInstanceBot</code> is a part of.
5555
* Only an <code>AppInstanceAdmin</code> can call the API with a user ARN that is not their own. </p>
5656
* <note>
5757
* <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the

‎clients/client-chime-sdk-messaging/src/commands/ListChannelMessagesCommand.ts

+5
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ export interface ListChannelMessagesCommandOutput extends ListChannelMessagesRes
103103
* // },
104104
* // },
105105
* // ContentType: "STRING_VALUE",
106+
* // Target: [ // TargetList
107+
* // { // Target
108+
* // MemberArn: "STRING_VALUE",
109+
* // },
110+
* // ],
106111
* // },
107112
* // ],
108113
* // SubChannelId: "STRING_VALUE",

‎clients/client-chime-sdk-messaging/src/commands/PutChannelMembershipPreferencesCommand.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ export interface PutChannelMembershipPreferencesCommandOutput
5050

5151
/**
5252
* @public
53-
* <p>Sets the membership preferences of an <code>AppInstanceUser</code> or <code>AppIntanceBot</code>
53+
* <p>Sets the membership preferences of an <code>AppInstanceUser</code> or <code>AppInstanceBot</code>
5454
* for the specified channel. The user or bot must be a member of the channel. Only the user or bot who owns the
5555
* membership can set preferences. Users or bots in the <code>AppInstanceAdmin</code> and channel moderator roles can't set
56-
* preferences for other users or users. Banned users or bots can't set membership preferences for the channel from
56+
* preferences for other users. Banned users or bots can't set membership preferences for the channel from
5757
* which they are banned.</p>
5858
* <note>
5959
* <p>The x-amz-chime-bearer request header is mandatory. Use the ARN of an

‎clients/client-chime-sdk-messaging/src/commands/SendChannelMessageCommand.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ export interface SendChannelMessageCommandOutput extends SendChannelMessageRespo
4949
* <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the
5050
* ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in
5151
* the header.</p>
52-
* <p>Also, <code>STANDARD</code> messages can contain 4KB of data and the 1KB of metadata.
53-
* <code>CONTROL</code> messages can contain 30 bytes of data and no metadata.</p>
52+
* <p>Also, <code>STANDARD</code> messages can be up to 4KB in size and contain metadata. Metadata is arbitrary,
53+
* and you can use it in a variety of ways, such as containing a link to an attachment.</p>
54+
* <p>
55+
* <code>CONTROL</code> messages are limited to 30 bytes and do not contain metadata.</p>
5456
* </note>
5557
* @example
5658
* Use a bare-bones client and the command you need to make an API call.
@@ -80,6 +82,11 @@ export interface SendChannelMessageCommandOutput extends SendChannelMessageRespo
8082
* },
8183
* SubChannelId: "STRING_VALUE",
8284
* ContentType: "STRING_VALUE",
85+
* Target: [ // TargetList
86+
* { // Target
87+
* MemberArn: "STRING_VALUE",
88+
* },
89+
* ],
8390
* };
8491
* const command = new SendChannelMessageCommand(input);
8592
* const response = await client.send(command);

‎clients/client-chime-sdk-messaging/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// smithy-typescript generated code
22
/* eslint-disable */
33
/**
4-
* <p>The Amazon Chime SDK Messaging APIs in this section allow software developers to send
4+
* <p>The Amazon Chime SDK messaging APIs in this section allow software developers to send
55
* and receive messages in custom messaging applications. These APIs depend on the frameworks
6-
* provided by the Amazon Chime SDK Identity APIs. For more information about the messaging
6+
* provided by the Amazon Chime SDK identity APIs. For more information about the messaging
77
* APIs, see <a href="https://docs.aws.amazon.com/chime/latest/APIReference/API_Operations_Amazon_Chime_SDK_Messaging.html">Amazon Chime SDK messaging</a>.</p>
88
*
99
* @packageDocumentation

‎clients/client-chime-sdk-messaging/src/models/models_0.ts

+70-13
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,9 @@ export interface ChannelMessageCallback {
827827
MessageId: string | undefined;
828828

829829
/**
830-
* <p>The message content.</p>
830+
* <p>The message content. For Amazon Lex V2 bot responses, this field holds a list of messages originating from the bot. For more information, refer to
831+
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
832+
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
831833
*/
832834
Content?: string;
833835

@@ -842,7 +844,9 @@ export interface ChannelMessageCallback {
842844
PushNotification?: PushNotificationConfiguration;
843845

844846
/**
845-
* <p>The attributes for the message, used for message filtering along with a <code>FilterRule</code> defined in the <code>PushNotificationPreferences</code>. </p>
847+
* <p>The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to specific fields from the bot. For more information, refer to
848+
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
849+
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
846850
*/
847851
MessageAttributes?: Record<string, MessageAttributeValue>;
848852

@@ -852,7 +856,10 @@ export interface ChannelMessageCallback {
852856
SubChannelId?: string;
853857

854858
/**
855-
* <p>The content type of the call-back message.</p>
859+
* <p>The content type of the call-back message. For Amazon Lex V2 bot responses, the content type is <code>application/amz-chime-lex-msgs</code> for success responses and
860+
* <code>application/amz-chime-lex-error</code> for failure responses. For more information, refer to
861+
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
862+
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
856863
*/
857864
ContentType?: string;
858865
}
@@ -990,7 +997,7 @@ export interface ChannelSummary {
990997
Metadata?: string;
991998

992999
/**
993-
* <p>The time at which the last persistent message in a channel was sent.</p>
1000+
* <p>The time at which the last persistent message visible to the caller in a channel was sent.</p>
9941001
*/
9951002
LastMessageTimestamp?: Date;
9961003
}
@@ -1093,11 +1100,23 @@ export interface ChannelMessageStatusStructure {
10931100
Value?: ChannelMessageStatus | string;
10941101

10951102
/**
1096-
* <p>Contains more details about the messasge status.</p>
1103+
* <p>Contains more details about the message status.</p>
10971104
*/
10981105
Detail?: string;
10991106
}
11001107

1108+
/**
1109+
* @public
1110+
* <p>The target of a message, a sender, a user, or a bot. Only the target and the sender can view targeted messages.
1111+
* Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can’t see.</p>
1112+
*/
1113+
export interface Target {
1114+
/**
1115+
* <p>The ARN of the target channel member.</p>
1116+
*/
1117+
MemberArn?: string;
1118+
}
1119+
11011120
/**
11021121
* @public
11031122
* @enum
@@ -1128,7 +1147,9 @@ export interface ChannelMessage {
11281147
MessageId?: string;
11291148

11301149
/**
1131-
* <p>The message content.</p>
1150+
* <p>The content of the channel message. For Amazon Lex V2 bot responses, this field holds a list of messages originating from the bot. For more information, refer to
1151+
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
1152+
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
11321153
*/
11331154
Content?: string;
11341155

@@ -1178,7 +1199,9 @@ export interface ChannelMessage {
11781199
Status?: ChannelMessageStatusStructure;
11791200

11801201
/**
1181-
* <p>The attributes for the message, used for message filtering along with a <code>FilterRule</code> defined in the <code>PushNotificationPreferences</code>.</p>
1202+
* <p>The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to specific fields from the bot. For more information, refer to
1203+
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
1204+
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
11821205
*/
11831206
MessageAttributes?: Record<string, MessageAttributeValue>;
11841207

@@ -1188,9 +1211,18 @@ export interface ChannelMessage {
11881211
SubChannelId?: string;
11891212

11901213
/**
1191-
* <p>The content type of the channel message.</p>
1214+
* <p>The content type of the channel message. For Amazon Lex V2 bot responses, the content type is <code>application/amz-chime-lex-msgs</code> for success responses and
1215+
* <code>application/amz-chime-lex-error</code> for failure responses. For more information, refer to
1216+
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
1217+
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
11921218
*/
11931219
ContentType?: string;
1220+
1221+
/**
1222+
* <p>The target of a message, a sender, a user, or a bot. Only the target and the sender can view targeted messages.
1223+
* Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can’t see.</p>
1224+
*/
1225+
Target?: Target[];
11941226
}
11951227

11961228
/**
@@ -1204,7 +1236,9 @@ export interface ChannelMessageSummary {
12041236
MessageId?: string;
12051237

12061238
/**
1207-
* <p>The content of the message.</p>
1239+
* <p>The content of the channel message. For Amazon Lex V2 bot responses, this field holds a list of messages originating from the bot. For more information, refer to
1240+
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
1241+
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
12081242
*/
12091243
Content?: string;
12101244

@@ -1250,14 +1284,25 @@ export interface ChannelMessageSummary {
12501284
Status?: ChannelMessageStatusStructure;
12511285

12521286
/**
1253-
* <p>The message attribues listed in a the summary of a channel message.</p>
1287+
* <p>The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to specific fields from the bot. For more information, refer to
1288+
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
1289+
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
12541290
*/
12551291
MessageAttributes?: Record<string, MessageAttributeValue>;
12561292

12571293
/**
1258-
* <p>The content type of the channel messsage listed in the summary.</p>
1294+
* <p>The content type of the channel message listed in the summary. For Amazon Lex V2 bot responses, the content type is <code>application/amz-chime-lex-msgs</code> for success responses and
1295+
* <code>application/amz-chime-lex-error</code> for failure responses. For more information, refer to
1296+
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
1297+
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
12591298
*/
12601299
ContentType?: string;
1300+
1301+
/**
1302+
* <p>The target of a message, a sender, a user, or a bot. Only the target and the sender can view targeted messages.
1303+
* Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can’t see.</p>
1304+
*/
1305+
Target?: Target[];
12611306
}
12621307

12631308
/**
@@ -2925,12 +2970,17 @@ export interface SendChannelMessageRequest {
29252970
ChannelArn: string | undefined;
29262971

29272972
/**
2928-
* <p>The content of the message.</p>
2973+
* <p>The content of the channel message.</p>
29292974
*/
29302975
Content: string | undefined;
29312976

29322977
/**
29332978
* <p>The type of message, <code>STANDARD</code> or <code>CONTROL</code>.</p>
2979+
* <p>
2980+
* <code>STANDARD</code> messages can be up to 4KB in size and contain metadata. Metadata is arbitrary,
2981+
* and you can use it in a variety of ways, such as containing a link to an attachment.</p>
2982+
* <p>
2983+
* <code>CONTROL</code> messages are limited to 30 bytes and do not contain metadata.</p>
29342984
*/
29352985
Type: ChannelMessageType | string | undefined;
29362986

@@ -2974,6 +3024,13 @@ export interface SendChannelMessageRequest {
29743024
* <p>The content type of the channel message.</p>
29753025
*/
29763026
ContentType?: string;
3027+
3028+
/**
3029+
* <p>The target of a message. Must be a member of the channel, such as another user, a bot, or the sender. Only the target and the sender can view targeted messages.
3030+
* Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can’t see.
3031+
* </p>
3032+
*/
3033+
Target?: Target[];
29773034
}
29783035

29793036
/**
@@ -3117,7 +3174,7 @@ export interface UpdateChannelMessageRequest {
31173174
MessageId: string | undefined;
31183175

31193176
/**
3120-
* <p>The content of the message being updated.</p>
3177+
* <p>The content of the channel message. </p>
31213178
*/
31223179
Content: string | undefined;
31233180

0 commit comments

Comments
 (0)
Please sign in to comment.