listInventoryEntries method

Future<ListInventoryEntriesResult> listInventoryEntries({
  1. required String instanceId,
  2. required String typeName,
  3. List<InventoryFilter>? filters,
  4. int? maxResults,
  5. String? nextToken,
})

A list of inventory items returned by the request.

May throw InternalServerError. May throw InvalidInstanceId. May throw InvalidTypeNameException. May throw InvalidFilter. May throw InvalidNextToken.

Parameter instanceId : The instance ID for which you want inventory information.

Parameter typeName : The type of inventory item for which you want information.

Parameter filters : 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<ListInventoryEntriesResult> listInventoryEntries({
  required String instanceId,
  required String typeName,
  List<InventoryFilter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(instanceId, 'instanceId');
  ArgumentError.checkNotNull(typeName, 'typeName');
  _s.validateStringLength(
    'typeName',
    typeName,
    1,
    100,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.ListInventoryEntries'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'InstanceId': instanceId,
      'TypeName': typeName,
      if (filters != null) 'Filters': filters,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListInventoryEntriesResult.fromJson(jsonResponse.body);
}