listObjectives method
Returns a paginated list of objectives from the Control Catalog.
You can apply an optional filter to see the objectives that belong to a specific domain. If you don’t provide a filter, the operation returns all objectives.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ThrottlingException.
May throw ValidationException.
Parameter maxResults :
The maximum number of results on a page or for an API request call.
Parameter nextToken :
The pagination token that's used to fetch the next set of results.
Parameter objectiveFilter :
An optional filter that narrows the results to a specific domain.
This filter allows you to specify one domain ARN at a time. Passing
multiple ARNs in the ObjectiveFilter isn’t supported.
Implementation
Future<ListObjectivesResponse> listObjectives({
int? maxResults,
String? nextToken,
ObjectiveFilter? objectiveFilter,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final $query = <String, List<String>>{
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
};
final $payload = <String, dynamic>{
if (objectiveFilter != null) 'ObjectiveFilter': objectiveFilter,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/objectives',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListObjectivesResponse.fromJson(response);
}