listPrompts method
Returns either information about the working draft (DRAFT
version) of each prompt in an account, or information about of all
versions of a prompt, depending on whether you include the
promptIdentifier field or not. For more information, see View
information about prompts using Prompt management in the Amazon
Bedrock User Guide.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter maxResults :
The maximum number of results to return in the response. If the total
number of results is greater than this value, use the token returned in
the response in the nextToken field when making another
request to return the next batch of results.
Parameter nextToken :
If the total number of results is greater than the maxResults
value provided in the request, enter the token returned in the
nextToken field in the response in this field to return the
next batch of results.
Parameter promptIdentifier :
The unique identifier of the prompt for whose versions you want to return
information. Omit this field to list information about all prompts in an
account.
Implementation
Future<ListPromptsResponse> listPrompts({
int? maxResults,
String? nextToken,
String? promptIdentifier,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
1000,
);
final $query = <String, List<String>>{
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
if (promptIdentifier != null) 'promptIdentifier': [promptIdentifier],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/prompts/',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListPromptsResponse.fromJson(response);
}