createFlow method
Creates a new flow in the specified Amazon Web Services account. Creates both a DRAFT and PUBLISHED (auto-published) version.
This operation is idempotent. Supply a ClientToken to safely
retry without creating duplicate resources.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalFailureException.
May throw InvalidParameterValueException.
May throw LimitExceededException.
May throw ResourceExistsException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter awsAccountId :
The ID of the Amazon Web Services account where you want to create the
flow.
Parameter flowDefinition :
The definition of the flow, specifying the steps and configurations. This
is the flow definition in Quick Flow's internal format. The format is
subject to change.
Parameter name :
The display name for the flow.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request.
Parameter description :
The description for the flow.
Parameter permissions :
Initial permissions for the flow. If omitted, the flow is created without
any permissions.
Implementation
Future<CreateFlowResponse> createFlow({
required String awsAccountId,
required Object flowDefinition,
required String name,
String? clientToken,
String? description,
List<Permission>? permissions,
}) async {
final $payload = <String, dynamic>{
'FlowDefinition': flowDefinition,
'Name': name,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'Description': description,
if (permissions != null) 'Permissions': permissions,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/accounts/${Uri.encodeComponent(awsAccountId)}/flows',
exceptionFnMap: _exceptionFns,
);
return CreateFlowResponse.fromJson(response);
}