createChannelFlow method
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
May throw BadRequestException.
May throw ConflictException.
May throw ForbiddenException.
May throw ResourceLimitExceededException.
May throw ServiceFailureException.
May throw ServiceUnavailableException.
May throw ThrottledClientException.
May throw UnauthorizedClientException.
Parameter appInstanceArn :
The ARN of the channel flow request.
Parameter name :
The name of the channel flow.
Parameter processors :
Information about the processor Lambda functions.
Parameter clientRequestToken :
The client token for the request. An Idempotency token.
Parameter tags :
The tags for the creation request.
Implementation
Future<CreateChannelFlowResponse> createChannelFlow({
required String appInstanceArn,
required String name,
required List<Processor> processors,
String? clientRequestToken,
List<Tag>? tags,
}) async {
final $payload = <String, dynamic>{
'AppInstanceArn': appInstanceArn,
'Name': name,
'Processors': processors,
'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/channel-flows',
exceptionFnMap: _exceptionFns,
);
return CreateChannelFlowResponse.fromJson(response);
}