listTrails method

Future<ListTrailsResponse> listTrails({
  1. String? nextToken,
})

Lists trails that are in the current account.

May throw UnsupportedOperationException. May throw OperationNotPermittedException.

Parameter nextToken : The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.

Implementation

Future<ListTrailsResponse> listTrails({
  String? nextToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.ListTrails'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListTrailsResponse.fromJson(jsonResponse.body);
}