listTunnels method

Future<ListTunnelsResponse> listTunnels({
  1. int? maxResults,
  2. String? nextToken,
  3. String? thingName,
})

List all tunnels for an AWS account. Tunnels are listed by creation time in descending order, newer tunnels will be listed before older tunnels.

Parameter maxResults : The maximum number of results to return at once.

Parameter nextToken : A token to retrieve the next set of results.

Parameter thingName : The name of the IoT thing associated with the destination device.

Implementation

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

  return ListTunnelsResponse.fromJson(jsonResponse.body);
}