describeEffectiveInstanceAssociations method

Future<DescribeEffectiveInstanceAssociationsResult> describeEffectiveInstanceAssociations({
  1. required String instanceId,
  2. int? maxResults,
  3. String? nextToken,
})

All associations for the instance(s).

May throw InternalServerError. May throw InvalidInstanceId. May throw InvalidNextToken.

Parameter instanceId : The instance ID for which you want to view all associations.

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<DescribeEffectiveInstanceAssociationsResult>
    describeEffectiveInstanceAssociations({
  required String instanceId,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(instanceId, 'instanceId');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    5,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.DescribeEffectiveInstanceAssociations'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'InstanceId': instanceId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeEffectiveInstanceAssociationsResult.fromJson(
      jsonResponse.body);
}