createAIGuardrailVersion method
Creates an Amazon Q in Connect AI Guardrail version.
May throw AccessDeniedException.
May throw ConflictException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw UnauthorizedException.
May throw ValidationException.
Parameter aiGuardrailId :
The identifier of the Amazon Q in Connect AI Guardrail.
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 Guardrail was last modified.
Implementation
Future<CreateAIGuardrailVersionResponse> createAIGuardrailVersion({
required String aiGuardrailId,
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)}/aiguardrails/${Uri.encodeComponent(aiGuardrailId)}/versions',
exceptionFnMap: _exceptionFns,
);
return CreateAIGuardrailVersionResponse.fromJson(response);
}