createAIAgentVersion method
Creates and Amazon Q in Connect AI Agent version.
May throw AccessDeniedException.
May throw ConflictException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw UnauthorizedException.
May throw ValidationException.
Parameter aiAgentId :
The identifier of the Amazon Q in Connect AI Agent.
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 modification time of the AI Agent should be tracked for version
creation. This field should be specified to avoid version creation when
simultaneous update to the underlying AI Agent are possible. The value
should be the modifiedTime returned from the request to create or update
an AI Agent so that version creation can fail if an update to the AI Agent
post the specified modification time has been made.
Implementation
Future<CreateAIAgentVersionResponse> createAIAgentVersion({
required String aiAgentId,
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)}/aiagents/${Uri.encodeComponent(aiAgentId)}/versions',
exceptionFnMap: _exceptionFns,
);
return CreateAIAgentVersionResponse.fromJson(response);
}