describeInterconnects method

Future<Interconnects> describeInterconnects({
  1. String? interconnectId,
  2. int? maxResults,
  3. String? nextToken,
})

Lists the interconnects owned by the Amazon Web Services account or only the specified interconnect.

May throw DirectConnectClientException. May throw DirectConnectServerException.

Parameter interconnectId : The ID of the interconnect.

Parameter maxResults : The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.

If MaxResults is given a value larger than 100, only 100 results are returned.

Parameter nextToken : The token for the next page of results.

Implementation

Future<Interconnects> describeInterconnects({
  String? interconnectId,
  int? maxResults,
  String? nextToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OvertureService.DescribeInterconnects'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (interconnectId != null) 'interconnectId': interconnectId,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return Interconnects.fromJson(jsonResponse.body);
}