Skip to content

Commit

Permalink
feat(client-chime-sdk-identity): AppInstanceBots can be configured to…
Browse files Browse the repository at this point in the history
… be invoked or not using the Target or the CHIME.mentions attribute for ChannelMessages
  • Loading branch information
awstools committed Jun 22, 2023
1 parent 71c4f39 commit b77d985
Show file tree
Hide file tree
Showing 10 changed files with 286 additions and 137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ export interface CreateAppInstanceBotCommandOutput extends CreateAppInstanceBotR
* ],
* Configuration: { // Configuration
* Lex: { // LexConfiguration
* RespondsTo: "STANDARD_MESSAGES", // required
* RespondsTo: "STANDARD_MESSAGES",
* InvokedBy: { // InvokedBy
* StandardMessages: "AUTO" || "ALL" || "MENTIONS" || "NONE", // required
* TargetedMessages: "ALL" || "NONE", // required
* },
* LexBotAliasArn: "STRING_VALUE", // required
* LocaleId: "STRING_VALUE", // required
* WelcomeIntent: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@s
import { SerdeContext as __SerdeContext } from "@smithy/types";

import { ChimeSDKIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ChimeSDKIdentityClient";
import {
DeregisterAppInstanceUserEndpointRequest,
DeregisterAppInstanceUserEndpointRequestFilterSensitiveLog,
} from "../models/models_0";
import { DeregisterAppInstanceUserEndpointRequest } from "../models/models_0";
import {
de_DeregisterAppInstanceUserEndpointCommand,
se_DeregisterAppInstanceUserEndpointCommand,
Expand Down Expand Up @@ -135,7 +132,7 @@ export class DeregisterAppInstanceUserEndpointCommand extends $Command<
logger,
clientName,
commandName,
inputFilterSensitiveLog: DeregisterAppInstanceUserEndpointRequestFilterSensitiveLog,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ export interface DescribeAppInstanceBotCommandOutput extends DescribeAppInstance
* // Name: "STRING_VALUE",
* // Configuration: { // Configuration
* // Lex: { // LexConfiguration
* // RespondsTo: "STANDARD_MESSAGES", // required
* // RespondsTo: "STANDARD_MESSAGES",
* // InvokedBy: { // InvokedBy
* // StandardMessages: "AUTO" || "ALL" || "MENTIONS" || "NONE", // required
* // TargetedMessages: "ALL" || "NONE", // required
* // },
* // LexBotAliasArn: "STRING_VALUE", // required
* // LocaleId: "STRING_VALUE", // required
* // WelcomeIntent: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { SerdeContext as __SerdeContext } from "@smithy/types";
import { ChimeSDKIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ChimeSDKIdentityClient";
import {
DescribeAppInstanceUserEndpointRequest,
DescribeAppInstanceUserEndpointRequestFilterSensitiveLog,
DescribeAppInstanceUserEndpointResponse,
DescribeAppInstanceUserEndpointResponseFilterSensitiveLog,
} from "../models/models_0";
Expand Down Expand Up @@ -158,7 +157,7 @@ export class DescribeAppInstanceUserEndpointCommand extends $Command<
logger,
clientName,
commandName,
inputFilterSensitiveLog: DescribeAppInstanceUserEndpointRequestFilterSensitiveLog,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: DescribeAppInstanceUserEndpointResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
RegisterAppInstanceUserEndpointRequest,
RegisterAppInstanceUserEndpointRequestFilterSensitiveLog,
RegisterAppInstanceUserEndpointResponse,
RegisterAppInstanceUserEndpointResponseFilterSensitiveLog,
} from "../models/models_0";
import {
de_RegisterAppInstanceUserEndpointCommand,
Expand Down Expand Up @@ -158,7 +157,7 @@ export class RegisterAppInstanceUserEndpointCommand extends $Command<
clientName,
commandName,
inputFilterSensitiveLog: RegisterAppInstanceUserEndpointRequestFilterSensitiveLog,
outputFilterSensitiveLog: RegisterAppInstanceUserEndpointResponseFilterSensitiveLog,
outputFilterSensitiveLog: (_: any) => _,
};
const { requestHandler } = configuration;
return stack.resolve(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ export interface UpdateAppInstanceBotCommandOutput extends UpdateAppInstanceBotR
* AppInstanceBotArn: "STRING_VALUE", // required
* Name: "STRING_VALUE", // required
* Metadata: "STRING_VALUE", // required
* Configuration: { // Configuration
* Lex: { // LexConfiguration
* RespondsTo: "STANDARD_MESSAGES",
* InvokedBy: { // InvokedBy
* StandardMessages: "AUTO" || "ALL" || "MENTIONS" || "NONE", // required
* TargetedMessages: "ALL" || "NONE", // required
* },
* LexBotAliasArn: "STRING_VALUE", // required
* LocaleId: "STRING_VALUE", // required
* WelcomeIntent: "STRING_VALUE",
* },
* },
* };
* const command = new UpdateAppInstanceBotCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
UpdateAppInstanceUserEndpointRequest,
UpdateAppInstanceUserEndpointRequestFilterSensitiveLog,
UpdateAppInstanceUserEndpointResponse,
UpdateAppInstanceUserEndpointResponseFilterSensitiveLog,
} from "../models/models_0";
import {
de_UpdateAppInstanceUserEndpointCommand,
Expand Down Expand Up @@ -149,7 +148,7 @@ export class UpdateAppInstanceUserEndpointCommand extends $Command<
clientName,
commandName,
inputFilterSensitiveLog: UpdateAppInstanceUserEndpointRequestFilterSensitiveLog,
outputFilterSensitiveLog: UpdateAppInstanceUserEndpointResponseFilterSensitiveLog,
outputFilterSensitiveLog: (_: any) => _,
};
const { requestHandler } = configuration;
return stack.resolve(
Expand Down
145 changes: 93 additions & 52 deletions clients/client-chime-sdk-identity/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,83 @@ export interface AppInstanceAdminSummary {
Admin?: Identity;
}

/**
* @public
* @enum
*/
export const StandardMessages = {
ALL: "ALL",
AUTO: "AUTO",
MENTIONS: "MENTIONS",
NONE: "NONE",
} as const;

/**
* @public
*/
export type StandardMessages = (typeof StandardMessages)[keyof typeof StandardMessages];

/**
* @public
* @enum
*/
export const TargetedMessages = {
ALL: "ALL",
NONE: "NONE",
} as const;

/**
* @public
*/
export type TargetedMessages = (typeof TargetedMessages)[keyof typeof TargetedMessages];

/**
* @public
* <p>Specifies the type of message that triggers a bot.</p>
*/
export interface InvokedBy {
/**
* <p>Sets standard messages as the bot trigger. For standard messages:</p>
* <ul>
* <li>
* <p>
* <code>ALL</code>: The bot processes all standard messages.</p>
* </li>
* <li>
* <p>
* <code>AUTO</code>: The bot responds to ALL messages when the channel has one other non-hidden member, and responds to MENTIONS when the
* channel has more than one other non-hidden member.</p>
* </li>
* <li>
* <p>
* <code>MENTIONS</code>: The bot processes all standard messages that have a message attribute with <code>CHIME.mentions</code> and a
* value of the bot ARN.</p>
* </li>
* <li>
* <p>
* <code>NONE</code>: The bot processes no standard messages.</p>
* </li>
* </ul>
*/
StandardMessages: StandardMessages | string | undefined;

/**
* <p>Sets targeted messages as the bot trigger. For targeted messages:</p>
* <ul>
* <li>
* <p>
* <code>ALL</code>: The bot processes all <code>TargetedMessages</code> sent to it. The bot then responds with a targeted message back to the sender.
* </p>
* </li>
* <li>
* <p>
* <code>NONE</code>: The bot processes no targeted messages.</p>
* </li>
* </ul>
*/
TargetedMessages: TargetedMessages | string | undefined;
}

/**
* @public
* @enum
Expand All @@ -116,9 +193,18 @@ export type RespondsTo = (typeof RespondsTo)[keyof typeof RespondsTo];
*/
export interface LexConfiguration {
/**
* <p>Determines whether the Amazon Lex V2 bot responds to all standard messages. Control messages are not supported.</p>
* <important>
* <p>
* <b>Deprecated</b>. Use <code>InvokedBy</code> instead.</p>
* </important>
* <p>Determines whether the Amazon Lex V2 bot responds to all standard messages. Control messages are not supported.</p>
*/
RespondsTo: RespondsTo | string | undefined;
RespondsTo?: RespondsTo | string;

/**
* <p>Specifies the type of message that triggers a bot.</p>
*/
InvokedBy?: InvokedBy;

/**
* <p>The ARN of the Amazon Lex V2 bot's alias. The ARN uses this format:
Expand Down Expand Up @@ -1586,6 +1672,11 @@ export interface UpdateAppInstanceBotRequest {
* <p>The metadata of the <code>AppInstanceBot</code>.</p>
*/
Metadata: string | undefined;

/**
* <p>The configuration for the bot update.</p>
*/
Configuration?: Configuration;
}

/**
Expand Down Expand Up @@ -1752,8 +1843,6 @@ export const EndpointAttributesFilterSensitiveLog = (obj: EndpointAttributes): a
*/
export const AppInstanceUserEndpointFilterSensitiveLog = (obj: AppInstanceUserEndpoint): any => ({
...obj,
...(obj.AppInstanceUserArn && { AppInstanceUserArn: SENSITIVE_STRING }),
...(obj.EndpointId && { EndpointId: SENSITIVE_STRING }),
...(obj.Name && { Name: SENSITIVE_STRING }),
...(obj.EndpointAttributes && { EndpointAttributes: EndpointAttributesFilterSensitiveLog(obj.EndpointAttributes) }),
});
Expand All @@ -1763,8 +1852,6 @@ export const AppInstanceUserEndpointFilterSensitiveLog = (obj: AppInstanceUserEn
*/
export const AppInstanceUserEndpointSummaryFilterSensitiveLog = (obj: AppInstanceUserEndpointSummary): any => ({
...obj,
...(obj.AppInstanceUserArn && { AppInstanceUserArn: SENSITIVE_STRING }),
...(obj.EndpointId && { EndpointId: SENSITIVE_STRING }),
...(obj.Name && { Name: SENSITIVE_STRING }),
});

Expand Down Expand Up @@ -1825,17 +1912,6 @@ export const CreateAppInstanceUserRequestFilterSensitiveLog = (obj: CreateAppIns
...(obj.Tags && { Tags: obj.Tags.map((item) => TagFilterSensitiveLog(item)) }),
});

/**
* @internal
*/
export const DeregisterAppInstanceUserEndpointRequestFilterSensitiveLog = (
obj: DeregisterAppInstanceUserEndpointRequest
): any => ({
...obj,
...(obj.AppInstanceUserArn && { AppInstanceUserArn: SENSITIVE_STRING }),
...(obj.EndpointId && { EndpointId: SENSITIVE_STRING }),
});

/**
* @internal
*/
Expand Down Expand Up @@ -1868,17 +1944,6 @@ export const DescribeAppInstanceUserResponseFilterSensitiveLog = (obj: DescribeA
...(obj.AppInstanceUser && { AppInstanceUser: AppInstanceUserFilterSensitiveLog(obj.AppInstanceUser) }),
});

/**
* @internal
*/
export const DescribeAppInstanceUserEndpointRequestFilterSensitiveLog = (
obj: DescribeAppInstanceUserEndpointRequest
): any => ({
...obj,
...(obj.AppInstanceUserArn && { AppInstanceUserArn: SENSITIVE_STRING }),
...(obj.EndpointId && { EndpointId: SENSITIVE_STRING }),
});

/**
* @internal
*/
Expand Down Expand Up @@ -2011,17 +2076,6 @@ export const RegisterAppInstanceUserEndpointRequestFilterSensitiveLog = (
...(obj.EndpointAttributes && { EndpointAttributes: EndpointAttributesFilterSensitiveLog(obj.EndpointAttributes) }),
});

/**
* @internal
*/
export const RegisterAppInstanceUserEndpointResponseFilterSensitiveLog = (
obj: RegisterAppInstanceUserEndpointResponse
): any => ({
...obj,
...(obj.AppInstanceUserArn && { AppInstanceUserArn: SENSITIVE_STRING }),
...(obj.EndpointId && { EndpointId: SENSITIVE_STRING }),
});

/**
* @internal
*/
Expand Down Expand Up @@ -2072,18 +2126,5 @@ export const UpdateAppInstanceUserEndpointRequestFilterSensitiveLog = (
obj: UpdateAppInstanceUserEndpointRequest
): any => ({
...obj,
...(obj.AppInstanceUserArn && { AppInstanceUserArn: SENSITIVE_STRING }),
...(obj.EndpointId && { EndpointId: SENSITIVE_STRING }),
...(obj.Name && { Name: SENSITIVE_STRING }),
});

/**
* @internal
*/
export const UpdateAppInstanceUserEndpointResponseFilterSensitiveLog = (
obj: UpdateAppInstanceUserEndpointResponse
): any => ({
...obj,
...(obj.AppInstanceUserArn && { AppInstanceUserArn: SENSITIVE_STRING }),
...(obj.EndpointId && { EndpointId: SENSITIVE_STRING }),
});
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ import {
EndpointAttributes,
ExpirationSettings,
ForbiddenException,
InvokedBy,
LexConfiguration,
NotFoundException,
ResourceLimitExceededException,
Expand Down Expand Up @@ -1084,6 +1085,7 @@ export const se_UpdateAppInstanceBotCommand = async (
let body: any;
body = JSON.stringify(
take(input, {
Configuration: (_) => _json(_),
Metadata: [],
Name: [],
})
Expand Down Expand Up @@ -3297,6 +3299,8 @@ const de_UnauthorizedClientExceptionRes = async (

// se_ExpirationSettings omitted.

// se_InvokedBy omitted.

// se_LexConfiguration omitted.

// se_Tag omitted.
Expand Down Expand Up @@ -3409,6 +3413,8 @@ const de_AppInstanceUserEndpoint = (output: any, context: __SerdeContext): AppIn

// de_Identity omitted.

// de_InvokedBy omitted.

// de_LexConfiguration omitted.

// de_Tag omitted.
Expand Down
Loading

0 comments on commit b77d985

Please sign in to comment.