Skip to content

Commit

Permalink
feat(client-chime-sdk-messaging): ChannelMessages can be made visible…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
awstools committed Jun 22, 2023
1 parent 7c50810 commit a9169d3
Show file tree
Hide file tree
Showing 16 changed files with 183 additions and 53 deletions.
4 changes: 2 additions & 2 deletions clients/client-chime-sdk-messaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

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

<p>The Amazon Chime SDK Messaging APIs in this section allow software developers to send
<p>The Amazon Chime SDK messaging APIs in this section allow software developers to send
and receive messages in custom messaging applications. These APIs depend on the frameworks
provided by the Amazon Chime SDK Identity APIs. For more information about the messaging
provided by the Amazon Chime SDK identity APIs. For more information about the messaging
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>

## Installing
Expand Down
4 changes: 2 additions & 2 deletions clients/client-chime-sdk-messaging/src/ChimeSDKMessaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1132,9 +1132,9 @@ export interface ChimeSDKMessaging {

/**
* @public
* <p>The Amazon Chime SDK Messaging APIs in this section allow software developers to send
* <p>The Amazon Chime SDK messaging APIs in this section allow software developers to send
* and receive messages in custom messaging applications. These APIs depend on the frameworks
* provided by the Amazon Chime SDK Identity APIs. For more information about the messaging
* provided by the Amazon Chime SDK identity APIs. For more information about the messaging
* 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>
*/
export class ChimeSDKMessaging extends ChimeSDKMessagingClient implements ChimeSDKMessaging {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,9 @@ export interface ChimeSDKMessagingClientResolvedConfig extends ChimeSDKMessaging

/**
* @public
* <p>The Amazon Chime SDK Messaging APIs in this section allow software developers to send
* <p>The Amazon Chime SDK messaging APIs in this section allow software developers to send
* and receive messages in custom messaging applications. These APIs depend on the frameworks
* provided by the Amazon Chime SDK Identity APIs. For more information about the messaging
* provided by the Amazon Chime SDK identity APIs. For more information about the messaging
* 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>
*/
export class ChimeSDKMessagingClient extends __Client<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface ChannelFlowCallbackCommandOutput extends ChannelFlowCallbackRes

/**
* @public
* <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>
* <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>
* <p>You can return one of the following processing responses:</p>
* <ul>
* <li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export interface CreateChannelFlowCommandOutput extends CreateChannelFlowRespons
* </li>
* </ol>
* <note>
* <p>Channel flows don't process Control or System messages. For more information about the message types provided by Chime SDK Messaging, refer to
* <p>Channel flows don't process Control or System messages. For more information about the message types provided by Chime SDK messaging, refer to
* <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>
* </note>
* @example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export interface GetChannelMembershipPreferencesCommandOutput
/**
* @public
* <p>Gets the membership preferences of an <code>AppInstanceUser</code> or <code>AppInstanceBot</code>
* for the specified channel. A user or a bot must be a member of the channel and own the membership to be able
* to retrieve membership preferences. Users or bots in the <code>AppInstanceAdmin</code> and channel moderator roles can't
* 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.
* Users or bots in the <code>AppInstanceAdmin</code> and channel moderator roles can't
* retrieve preferences for other users or bots. Banned users or bots can't retrieve membership preferences for the
* channel from which they are banned.</p>
* <note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ export interface GetChannelMessageCommandOutput extends GetChannelMessageRespons
* // },
* // SubChannelId: "STRING_VALUE",
* // ContentType: "STRING_VALUE",
* // Target: [ // TargetList
* // { // Target
* // MemberArn: "STRING_VALUE",
* // },
* // ],
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface GetChannelMessageStatusCommandOutput extends GetChannelMessageS
* </dd>
* <dt>DENIED</dt>
* <dd>
* <p>Messasge denied by the processor</p>
* <p>Message denied by the processor</p>
* </dd>
* </dl>
* <note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface ListChannelMembershipsForAppInstanceUserCommandOutput

/**
* @public
* <p> Lists all channels that anr <code>AppInstanceUser</code> or <code>AppInstanceBot</code> is a part of.
* <p> Lists all channels that an <code>AppInstanceUser</code> or <code>AppInstanceBot</code> is a part of.
* Only an <code>AppInstanceAdmin</code> can call the API with a user ARN that is not their own. </p>
* <note>
* <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ export interface ListChannelMessagesCommandOutput extends ListChannelMessagesRes
* // },
* // },
* // ContentType: "STRING_VALUE",
* // Target: [ // TargetList
* // { // Target
* // MemberArn: "STRING_VALUE",
* // },
* // ],
* // },
* // ],
* // SubChannelId: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ export interface PutChannelMembershipPreferencesCommandOutput

/**
* @public
* <p>Sets the membership preferences of an <code>AppInstanceUser</code> or <code>AppIntanceBot</code>
* <p>Sets the membership preferences of an <code>AppInstanceUser</code> or <code>AppInstanceBot</code>
* for the specified channel. The user or bot must be a member of the channel. Only the user or bot who owns the
* membership can set preferences. Users or bots in the <code>AppInstanceAdmin</code> and channel moderator roles can't set
* preferences for other users or users. Banned users or bots can't set membership preferences for the channel from
* preferences for other users. Banned users or bots can't set membership preferences for the channel from
* which they are banned.</p>
* <note>
* <p>The x-amz-chime-bearer request header is mandatory. Use the ARN of an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ export interface SendChannelMessageCommandOutput extends SendChannelMessageRespo
* <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the
* ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in
* the header.</p>
* <p>Also, <code>STANDARD</code> messages can contain 4KB of data and the 1KB of metadata.
* <code>CONTROL</code> messages can contain 30 bytes of data and no metadata.</p>
* <p>Also, <code>STANDARD</code> messages can be up to 4KB in size and contain metadata. Metadata is arbitrary,
* and you can use it in a variety of ways, such as containing a link to an attachment.</p>
* <p>
* <code>CONTROL</code> messages are limited to 30 bytes and do not contain metadata.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down Expand Up @@ -80,6 +82,11 @@ export interface SendChannelMessageCommandOutput extends SendChannelMessageRespo
* },
* SubChannelId: "STRING_VALUE",
* ContentType: "STRING_VALUE",
* Target: [ // TargetList
* { // Target
* MemberArn: "STRING_VALUE",
* },
* ],
* };
* const command = new SendChannelMessageCommand(input);
* const response = await client.send(command);
Expand Down
4 changes: 2 additions & 2 deletions clients/client-chime-sdk-messaging/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// smithy-typescript generated code
/* eslint-disable */
/**
* <p>The Amazon Chime SDK Messaging APIs in this section allow software developers to send
* <p>The Amazon Chime SDK messaging APIs in this section allow software developers to send
* and receive messages in custom messaging applications. These APIs depend on the frameworks
* provided by the Amazon Chime SDK Identity APIs. For more information about the messaging
* provided by the Amazon Chime SDK identity APIs. For more information about the messaging
* 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>
*
* @packageDocumentation
Expand Down
83 changes: 70 additions & 13 deletions clients/client-chime-sdk-messaging/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,9 @@ export interface ChannelMessageCallback {
MessageId: string | undefined;

/**
* <p>The message content.</p>
* <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
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
*/
Content?: string;

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

/**
* <p>The attributes for the message, used for message filtering along with a <code>FilterRule</code> defined in the <code>PushNotificationPreferences</code>. </p>
* <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
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
*/
MessageAttributes?: Record<string, MessageAttributeValue>;

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

/**
* <p>The content type of the call-back message.</p>
* <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
* <code>application/amz-chime-lex-error</code> for failure responses. For more information, refer to
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
*/
ContentType?: string;
}
Expand Down Expand Up @@ -990,7 +997,7 @@ export interface ChannelSummary {
Metadata?: string;

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

/**
* <p>Contains more details about the messasge status.</p>
* <p>Contains more details about the message status.</p>
*/
Detail?: string;
}

/**
* @public
* <p>The target of a message, a sender, a user, or a bot. Only the target and the sender can view targeted messages.
* Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can’t see.</p>
*/
export interface Target {
/**
* <p>The ARN of the target channel member.</p>
*/
MemberArn?: string;
}

/**
* @public
* @enum
Expand Down Expand Up @@ -1128,7 +1147,9 @@ export interface ChannelMessage {
MessageId?: string;

/**
* <p>The message content.</p>
* <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
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
*/
Content?: string;

Expand Down Expand Up @@ -1178,7 +1199,9 @@ export interface ChannelMessage {
Status?: ChannelMessageStatusStructure;

/**
* <p>The attributes for the message, used for message filtering along with a <code>FilterRule</code> defined in the <code>PushNotificationPreferences</code>.</p>
* <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
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
*/
MessageAttributes?: Record<string, MessageAttributeValue>;

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

/**
* <p>The content type of the channel message.</p>
* <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
* <code>application/amz-chime-lex-error</code> for failure responses. For more information, refer to
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
*/
ContentType?: string;

/**
* <p>The target of a message, a sender, a user, or a bot. Only the target and the sender can view targeted messages.
* Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can’t see.</p>
*/
Target?: Target[];
}

/**
Expand All @@ -1204,7 +1236,9 @@ export interface ChannelMessageSummary {
MessageId?: string;

/**
* <p>The content of the message.</p>
* <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
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
*/
Content?: string;

Expand Down Expand Up @@ -1250,14 +1284,25 @@ export interface ChannelMessageSummary {
Status?: ChannelMessageStatusStructure;

/**
* <p>The message attribues listed in a the summary of a channel message.</p>
* <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
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
*/
MessageAttributes?: Record<string, MessageAttributeValue>;

/**
* <p>The content type of the channel messsage listed in the summary.</p>
* <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
* <code>application/amz-chime-lex-error</code> for failure responses. For more information, refer to
* <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html">Processing responses from an AppInstanceBot</a> in the
* <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>
*/
ContentType?: string;

/**
* <p>The target of a message, a sender, a user, or a bot. Only the target and the sender can view targeted messages.
* Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can’t see.</p>
*/
Target?: Target[];
}

/**
Expand Down Expand Up @@ -2925,12 +2970,17 @@ export interface SendChannelMessageRequest {
ChannelArn: string | undefined;

/**
* <p>The content of the message.</p>
* <p>The content of the channel message.</p>
*/
Content: string | undefined;

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

Expand Down Expand Up @@ -2974,6 +3024,13 @@ export interface SendChannelMessageRequest {
* <p>The content type of the channel message.</p>
*/
ContentType?: string;

/**
* <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.
* Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can’t see.
* </p>
*/
Target?: Target[];
}

/**
Expand Down Expand Up @@ -3117,7 +3174,7 @@ export interface UpdateChannelMessageRequest {
MessageId: string | undefined;

/**
* <p>The content of the message being updated.</p>
* <p>The content of the channel message. </p>
*/
Content: string | undefined;

Expand Down
Loading

0 comments on commit a9169d3

Please sign in to comment.