createContactFlowModule method

Future<CreateContactFlowModuleResponse> createContactFlowModule({
  1. required String content,
  2. required String instanceId,
  3. required String name,
  4. String? clientToken,
  5. String? description,
  6. ExternalInvocationConfiguration? externalInvocationConfiguration,
  7. String? settings,
  8. Map<String, String>? tags,
})

Creates a flow module for the specified Connect Customer instance.

May throw AccessDeniedException. May throw DuplicateResourceException. May throw IdempotencyException. May throw InternalServiceException. May throw InvalidContactFlowModuleException. May throw InvalidParameterException. May throw InvalidRequestException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter content : The JSON string that represents the content of the flow. For an example, see Example flow in Connect Customer Flow language.

Parameter instanceId : The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Parameter name : The name of the flow module.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

Parameter description : The description of the flow module.

Parameter externalInvocationConfiguration : The external invocation configuration for the flow module.

Parameter settings : The configuration settings for the flow module.

Parameter tags : The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

Implementation

Future<CreateContactFlowModuleResponse> createContactFlowModule({
  required String content,
  required String instanceId,
  required String name,
  String? clientToken,
  String? description,
  ExternalInvocationConfiguration? externalInvocationConfiguration,
  String? settings,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'Content': content,
    'Name': name,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'Description': description,
    if (externalInvocationConfiguration != null)
      'ExternalInvocationConfiguration': externalInvocationConfiguration,
    if (settings != null) 'Settings': settings,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/contact-flow-modules/${Uri.encodeComponent(instanceId)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateContactFlowModuleResponse.fromJson(response);
}