channel_flows
Creates, updates, deletes, gets or lists a channel_flows resource.
Overview
| Name | channel_flows |
| Type | Resource |
| Id | aws.chime_sdk_messaging.channel_flows |
Fields
The following fields are returned by SELECT queries:
- list_channel_flows
- describe_channel_flow
| Name | Datatype | Description |
|---|---|---|
channel_flows | array | The information about each channel flow. |
next_token | string | The token passed by previous API calls until all requested channels are returned. (pattern: <code>.*</code>) |
| Name | Datatype | Description |
|---|---|---|
channel_flow_arn | string | The ARN of the channel flow. (pattern: <code>arn:[a-z0-9-.]{1,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[^/].{0,1023}</code>) |
created_timestamp | string (date-time) | The time at which the channel flow was created. |
last_updated_timestamp | string (date-time) | The time at which a channel flow was updated. |
name | string | The name of the channel flow. (pattern: <code>[\u0009\u000A\u000D\u0020-\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]*</code>) |
processors | array | Information about the processor Lambda functions. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_channel_flows | select | app-instance-arn, region | max-results, next-token | Returns a paginated lists of all the channel flows created under a single Chime. This is a developer API. |
describe_channel_flow | select | channel_flow_arn, region | Returns the full details of a channel flow in an Amazon Chime AppInstance. This is a developer API. | |
create_channel_flow | insert | region, AppInstanceArn, Processors, Name, ClientRequestToken | Creates a channel flow, a container for processors. Processors are AWS Lambda functions that perform actions on chat messages, such as stripping out profanity. You can associate channel flows with channels, and the processors in the channel flow then take action on all messages sent to that channel. This is a developer API. Channel flows process the following items: New and updated messages Persistent and non-persistent messages The Standard message type Channel flows don't process Control or System messages. For more information about the message types provided by Chime SDK messaging, refer to Message types in the Amazon Chime developer guide. | |
associate_channel_flow | update | channel_arn, x-amz-chime-bearer, region, ChannelFlowArn | Associates a channel flow with a channel. Once associated, all messages to that channel go through channel flow processors. To stop processing, use the DisassociateChannelFlow API. Only administrators or channel moderators can associate a channel flow. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header. | |
update_channel_flow | update | channel_flow_arn, region, Processors, Name | Updates channel flow attributes. This is a developer API. | |
disassociate_channel_flow | update | channel_arn, channel_flow_arn, x-amz-chime-bearer, region | Disassociates a channel flow from all its channels. Once disassociated, all messages to that channel stop going through the channel flow processor. Only administrators or channel moderators can disassociate a channel flow. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header. | |
delete_channel_flow | delete | channel_flow_arn, region | Deletes a channel flow, an irreversible process. This is a developer API. This API works only when the channel flow is not associated with any channel. To get a list of all channels that a channel flow is associated with, use the ListChannelsAssociatedWithChannelFlow API. Use the DisassociateChannelFlow API to disassociate a channel flow from all channels. | |
channel_flow_callback | exec | channel_arn, region, CallbackId, ChannelMessage | Calls back Amazon Chime SDK messaging with a processing response message. This should be invoked from the processor Lambda. This is a developer API. You can return one of the following processing responses: Update message content or metadata Deny a message Make no changes to the message |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
app-instance-arn | string | The ARN of the app instance. |
channel_arn | string | The ARN of the channel. |
channel_flow_arn | string | The ARN of the channel flow. |
region | string | AWS region (default: us-east-1) |
x-amz-chime-bearer | string | The AppInstanceUserArn of the user making the API call. |
max-results | integer | The maximum number of channel flows that you want to return. |
next-token | string | The token passed by previous API calls until all requested channel flows are returned. |
SELECT examples
- list_channel_flows
- describe_channel_flow
Returns a paginated lists of all the channel flows created under a single Chime. This is a developer API.
SELECT
channel_flows,
next_token
FROM aws.chime_sdk_messaging.channel_flows
WHERE `app-instance-arn` = '{{ app-instance-arn }}' -- required
AND region = '{{ region }}' -- required
AND `max-results` = '{{ max-results }}'
AND `next-token` = '{{ next-token }}'
;
Returns the full details of a channel flow in an Amazon Chime AppInstance. This is a developer API.
SELECT
channel_flow_arn,
created_timestamp,
last_updated_timestamp,
name,
processors
FROM aws.chime_sdk_messaging.channel_flows
WHERE channel_flow_arn = '{{ channel_flow_arn }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples
- create_channel_flow
- Manifest
Creates a channel flow, a container for processors. Processors are AWS Lambda functions that perform actions on chat messages, such as stripping out profanity. You can associate channel flows with channels, and the processors in the channel flow then take action on all messages sent to that channel. This is a developer API. Channel flows process the following items: New and updated messages Persistent and non-persistent messages The Standard message type Channel flows don't process Control or System messages. For more information about the message types provided by Chime SDK messaging, refer to Message types in the Amazon Chime developer guide.
INSERT INTO aws.chime_sdk_messaging.channel_flows (
AppInstanceArn,
Processors,
Name,
Tags,
ClientRequestToken,
region
)
SELECT
'{{ AppInstanceArn }}' /* required */,
'{{ Processors }}' /* required */,
'{{ Name }}' /* required */,
'{{ Tags }}',
'{{ ClientRequestToken }}' /* required */,
'{{ region }}'
RETURNING
channel_flow_arn
;
# Description fields are for documentation purposes
- name: channel_flows
props:
- name: region
value: "{{ region }}"
description: Required parameter for the channel_flows resource.
- name: AppInstanceArn
value: "{{ AppInstanceArn }}"
- name: Processors
value:
- Name: "{{ Name }}"
Configuration:
Lambda:
ResourceArn: "{{ ResourceArn }}"
InvocationType: "{{ InvocationType }}"
ExecutionOrder: {{ ExecutionOrder }}
FallbackAction: "{{ FallbackAction }}"
- name: Name
value: "{{ Name }}"
- name: Tags
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: ClientRequestToken
value: "{{ ClientRequestToken }}"
UPDATE examples
- associate_channel_flow
- update_channel_flow
- disassociate_channel_flow
Associates a channel flow with a channel. Once associated, all messages to that channel go through channel flow processors. To stop processing, use the DisassociateChannelFlow API. Only administrators or channel moderators can associate a channel flow. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
UPDATE aws.chime_sdk_messaging.channel_flows
SET
ChannelFlowArn = '{{ ChannelFlowArn }}'
WHERE
channel_arn = '{{ channel_arn }}' --required
AND `x-amz-chime-bearer` = '{{ x-amz-chime-bearer }}' --required
AND region = '{{ region }}' --required
AND ChannelFlowArn = '{{ ChannelFlowArn }}' --required;
Updates channel flow attributes. This is a developer API.
UPDATE aws.chime_sdk_messaging.channel_flows
SET
Processors = '{{ Processors }}',
Name = '{{ Name }}'
WHERE
channel_flow_arn = '{{ channel_flow_arn }}' --required
AND region = '{{ region }}' --required
AND Processors = '{{ Processors }}' --required
AND Name = '{{ Name }}' --required
RETURNING
channel_flow_arn;
Disassociates a channel flow from all its channels. Once disassociated, all messages to that channel stop going through the channel flow processor. Only administrators or channel moderators can disassociate a channel flow. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
UPDATE aws.chime_sdk_messaging.channel_flows
SET
-- No updatable properties
WHERE
channel_arn = '{{ channel_arn }}' --required
AND channel_flow_arn = '{{ channel_flow_arn }}' --required
AND `x-amz-chime-bearer` = '{{ x-amz-chime-bearer }}' --required
AND region = '{{ region }}' --required;
DELETE examples
- delete_channel_flow
Deletes a channel flow, an irreversible process. This is a developer API. This API works only when the channel flow is not associated with any channel. To get a list of all channels that a channel flow is associated with, use the ListChannelsAssociatedWithChannelFlow API. Use the DisassociateChannelFlow API to disassociate a channel flow from all channels.
DELETE FROM aws.chime_sdk_messaging.channel_flows
WHERE channel_flow_arn = '{{ channel_flow_arn }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- channel_flow_callback
Calls back Amazon Chime SDK messaging with a processing response message. This should be invoked from the processor Lambda. This is a developer API. You can return one of the following processing responses: Update message content or metadata Deny a message Make no changes to the message
EXEC aws.chime_sdk_messaging.channel_flows.channel_flow_callback
@channel_arn='{{ channel_arn }}' --required,
@region='{{ region }}' --required
@@json=
'{
"CallbackId": "{{ CallbackId }}",
"DeleteResource": {{ DeleteResource }},
"ChannelMessage": "{{ ChannelMessage }}"
}'
;