createContactFlowVersion method
Publishes a new version of the flow provided. Versions are immutable and
monotonically increasing. If the FlowContentSha256 provided
is different from the FlowContentSha256 of the
$LATEST published flow content, then an error is returned.
This API only supports creating versions for flows of type
Campaign.
May throw AccessDeniedException.
May throw InternalServiceException.
May throw InvalidParameterException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter contactFlowId :
The identifier of the flow.
Parameter instanceId :
The identifier of the Connect Customer instance.
Parameter contactFlowVersion :
The identifier of the flow version.
Parameter description :
The description of the flow version.
Parameter flowContentSha256 :
Indicates the checksum value of the flow content.
Parameter lastModifiedRegion :
The Amazon Web Services Region where this resource was last modified.
Parameter lastModifiedTime :
The Amazon Web Services Region where this resource was last modified.
Implementation
Future<CreateContactFlowVersionResponse> createContactFlowVersion({
required String contactFlowId,
required String instanceId,
int? contactFlowVersion,
String? description,
String? flowContentSha256,
String? lastModifiedRegion,
DateTime? lastModifiedTime,
}) async {
_s.validateNumRange(
'contactFlowVersion',
contactFlowVersion,
1,
1152921504606846976,
);
final $payload = <String, dynamic>{
if (contactFlowVersion != null) 'ContactFlowVersion': contactFlowVersion,
if (description != null) 'Description': description,
if (flowContentSha256 != null) 'FlowContentSha256': flowContentSha256,
if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion,
if (lastModifiedTime != null)
'LastModifiedTime': unixTimestampToJson(lastModifiedTime),
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/contact-flows/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactFlowId)}/version',
exceptionFnMap: _exceptionFns,
);
return CreateContactFlowVersionResponse.fromJson(response);
}