listConnections method

Future<ListConnectionsResponse> listConnections({
  1. AttachPoint? attachPoint,
  2. String? environmentId,
  3. int? maxResults,
  4. String? nextToken,
  5. Provider? provider,
  6. ConnectionState? state,
})

Lists all connection objects to which the caller has access.

Allows for optional filtering by the following properties:

  • state
  • environmentId
  • provider
  • attach point
Only Connection objects matching all filters will be returned.

Parameter attachPoint : Filter results to only include Connection objects attached to the given AttachPoint.

Parameter environmentId : Filter the results to only include Connection objects on the given Environment.

Parameter maxResults : The max number of list results in a single paginated response.

Parameter nextToken : A pagination token from a previous paginated response indicating you wish to get the next page of results.

Parameter provider : Filter the results to only include Connection objects to the given Provider.

Parameter state : Filter the results to only include Connection objects in the given Connection$state.

Implementation

Future<ListConnectionsResponse> listConnections({
  AttachPoint? attachPoint,
  String? environmentId,
  int? maxResults,
  String? nextToken,
  Provider? provider,
  ConnectionState? state,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'Interconnect.ListConnections'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (attachPoint != null) 'attachPoint': attachPoint,
      if (environmentId != null) 'environmentId': environmentId,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
      if (provider != null) 'provider': provider,
      if (state != null) 'state': state.value,
    },
  );

  return ListConnectionsResponse.fromJson(jsonResponse.body);
}