createContactFlow method
Creates a contact flow for the specified Amazon Connect instance.
You can also create and update contact flows using the Amazon Connect Flow language.
May throw InvalidRequestException. May throw InvalidContactFlowException. May throw InvalidParameterException. May throw DuplicateResourceException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw InternalServiceException.
Parameter content
:
The content of the contact flow.
Parameter instanceId
:
The identifier of the Amazon Connect instance.
Parameter name
:
The name of the contact flow.
Parameter type
:
The type of the contact flow. For descriptions of the available types, see
Choose
a Contact Flow Type in the Amazon Connect Administrator Guide.
Parameter description
:
The description of the contact flow.
Parameter tags
:
One or more tags.
Implementation
Future<CreateContactFlowResponse> createContactFlow({
required String content,
required String instanceId,
required String name,
required ContactFlowType type,
String? description,
Map<String, String>? tags,
}) async {
ArgumentError.checkNotNull(content, 'content');
ArgumentError.checkNotNull(instanceId, 'instanceId');
_s.validateStringLength(
'instanceId',
instanceId,
1,
100,
isRequired: true,
);
ArgumentError.checkNotNull(name, 'name');
_s.validateStringLength(
'name',
name,
1,
1152921504606846976,
isRequired: true,
);
ArgumentError.checkNotNull(type, 'type');
final $payload = <String, dynamic>{
'Content': content,
'Name': name,
'Type': type.toValue(),
if (description != null) 'Description': description,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/contact-flows/${Uri.encodeComponent(instanceId)}',
exceptionFnMap: _exceptionFns,
);
return CreateContactFlowResponse.fromJson(response);
}