createAIPromptVersion method
Creates an Amazon Q in Connect AI Prompt version.
May throw AccessDeniedException.
May throw ConflictException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw UnauthorizedException.
May throw ValidationException.
Parameter aiPromptId :
The identifier of the Amazon Q in Connect AI prompt.
Parameter assistantId :
The identifier of the Amazon Q in Connect assistant. Can be either the ID
or the ARN. URLs cannot contain the ARN.
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 modifiedTime :
The time the AI Prompt was last modified.
Implementation
Future<CreateAIPromptVersionResponse> createAIPromptVersion({
required String aiPromptId,
required String assistantId,
String? clientToken,
DateTime? modifiedTime,
}) async {
final $payload = <String, dynamic>{
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (modifiedTime != null)
'modifiedTime': unixTimestampToJson(modifiedTime),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/assistants/${Uri.encodeComponent(assistantId)}/aiprompts/${Uri.encodeComponent(aiPromptId)}/versions',
exceptionFnMap: _exceptionFns,
);
return CreateAIPromptVersionResponse.fromJson(response);
}