updateFlow method

Future<UpdateFlowResponse> updateFlow({
  1. required String awsAccountId,
  2. required String flowId,
  3. String? clientToken,
  4. String? description,
  5. Object? flowDefinition,
  6. String? name,
})

Updates an existing flow. Supply only the fields you want to change. Updates both DRAFT and PUBLISHED versions. When FlowDefinition is provided, all existing steps are replaced with the new definition.

May throw AccessDeniedException. May throw ConflictException. May throw InternalFailureException. May throw InvalidParameterValueException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter awsAccountId : The ID of the Amazon Web Services account that contains the flow that you are updating.

Parameter flowId : The unique identifier of the flow to update.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Parameter description : Updated description for the flow. Omit to preserve the existing description.

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. When provided, all existing steps are replaced. Omit to preserve the existing definition.

Parameter name : Updated display name for the flow. Omit to preserve the existing name.

Implementation

Future<UpdateFlowResponse> updateFlow({
  required String awsAccountId,
  required String flowId,
  String? clientToken,
  String? description,
  Object? flowDefinition,
  String? name,
}) async {
  final $payload = <String, dynamic>{
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'Description': description,
    if (flowDefinition != null) 'FlowDefinition': flowDefinition,
    if (name != null) 'Name': name,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/flows/${Uri.encodeComponent(flowId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateFlowResponse.fromJson(response);
}