listConnections method

Future<ListConnectionsOutput> listConnections({
  1. String? hostArnFilter,
  2. int? maxResults,
  3. String? nextToken,
  4. ProviderType? providerTypeFilter,
})

Lists the connections associated with your account.

Parameter hostArnFilter : Filters the list of connections to those associated with a specified host.

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

Parameter nextToken : The token that was returned from the previous ListConnections call, which can be used to return the next set of connections in the list.

Parameter providerTypeFilter : Filters the list of connections to those associated with a specified provider, such as Bitbucket.

Implementation

Future<ListConnectionsOutput> listConnections({
  String? hostArnFilter,
  int? maxResults,
  String? nextToken,
  ProviderType? providerTypeFilter,
}) async {
  _s.validateStringLength(
    'hostArnFilter',
    hostArnFilter,
    0,
    256,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target':
        'com.amazonaws.codestar.connections.CodeStar_connections_20191201.ListConnections'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (hostArnFilter != null) 'HostArnFilter': hostArnFilter,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (providerTypeFilter != null)
        'ProviderTypeFilter': providerTypeFilter.toValue(),
    },
  );

  return ListConnectionsOutput.fromJson(jsonResponse.body);
}