getOutcomes method

Future<GetOutcomesResult> getOutcomes({
  1. int? maxResults,
  2. String? name,
  3. String? nextToken,
})

Gets one or more outcomes. This is a paginated API. If you provide a null maxResults, this actions retrieves a maximum of 100 records per page. If you provide a maxResults, the value must be between 50 and 100. To get the next page results, provide the pagination token from the GetOutcomesResult as part of your request. A null pagination token fetches the records from the beginning.

May throw ValidationException. May throw ResourceNotFoundException. May throw InternalServerException. May throw ThrottlingException. May throw AccessDeniedException.

Parameter maxResults : The maximum number of objects to return for the request.

Parameter name : The name of the outcome or outcomes to get.

Parameter nextToken : The next page token for the request.

Implementation

Future<GetOutcomesResult> getOutcomes({
  int? maxResults,
  String? name,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    50,
    100,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    64,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSHawksNestServiceFacade.GetOutcomes'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'maxResults': maxResults,
      if (name != null) 'name': name,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return GetOutcomesResult.fromJson(jsonResponse.body);
}