createRetriever method
Adds a retriever to your Amazon Q Business application.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter applicationId :
The identifier of your Amazon Q Business application.
Parameter displayName :
The name of your retriever.
Parameter type :
The type of retriever you are using.
Parameter clientToken :
A token that you provide to identify the request to create your Amazon Q
Business application retriever.
Parameter roleArn :
The ARN of an IAM role used by Amazon Q Business to access the basic
authentication credentials stored in a Secrets Manager secret.
Parameter tags :
A list of key-value pairs that identify or categorize the retriever. You
can also use tags to help control access to the retriever. Tag keys and
values can consist of Unicode letters, digits, white space, and any of the
following symbols: _ . : / = + - @.
Implementation
Future<CreateRetrieverResponse> createRetriever({
required String applicationId,
required RetrieverConfiguration configuration,
required String displayName,
required RetrieverType type,
String? clientToken,
String? roleArn,
List<Tag>? tags,
}) async {
final $payload = <String, dynamic>{
'configuration': configuration,
'displayName': displayName,
'type': type.value,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (roleArn != null) 'roleArn': roleArn,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/applications/${Uri.encodeComponent(applicationId)}/retrievers',
exceptionFnMap: _exceptionFns,
);
return CreateRetrieverResponse.fromJson(response);
}