listConnections method

Future<ListConnectionsResponse> listConnections({
  1. String? connectionName,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list of App Runner connections that are associated with your Amazon Web Services account.

May throw InternalServiceErrorException. May throw InvalidRequestException.

Parameter connectionName : If specified, only this connection is returned. If not specified, the result isn't filtered by name.

Parameter maxResults : The maximum number of results to include in each response (result page). Used for a paginated request.

If you don't specify MaxResults, the request retrieves all available results in a single response.

Parameter nextToken : A token from a previous result page. Used for a paginated request. The request retrieves the next result page. All other parameter values must be identical to the ones specified in the initial request.

If you don't specify NextToken, the request retrieves the first result page.

Implementation

Future<ListConnectionsResponse> listConnections({
  String? connectionName,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AppRunner.ListConnections'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (connectionName != null) 'ConnectionName': connectionName,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListConnectionsResponse.fromJson(jsonResponse.body);
}