listAssociations method

Future<ListAssociationsResult> listAssociations({
  1. List<AssociationFilter>? associationFilterList,
  2. int? maxResults,
  3. String? nextToken,
})

Returns all State Manager associations in the current AWS account and Region. You can limit the results to a specific State Manager association document or instance by specifying a filter.

May throw InternalServerError. May throw InvalidNextToken.

Parameter associationFilterList : One or more filters. Use a filter to return a more specific list of results.

Parameter maxResults : The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Parameter nextToken : The token for the next set of items to return. (You received this token from a previous call.)

Implementation

Future<ListAssociationsResult> listAssociations({
  List<AssociationFilter>? associationFilterList,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.ListAssociations'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (associationFilterList != null)
        'AssociationFilterList': associationFilterList,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListAssociationsResult.fromJson(jsonResponse.body);
}