describeSnapshots method

Future<DescribeSnapshotsResult> describeSnapshots({
  1. String? directoryId,
  2. int? limit,
  3. String? nextToken,
  4. List<String>? snapshotIds,
})

Obtains information about the directory snapshots that belong to this account.

This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the DescribeSnapshots.NextToken member contains a token that you pass in the next call to DescribeSnapshots to retrieve the next set of items.

You can also specify a maximum number of return results with the Limit parameter.

May throw EntityDoesNotExistException. May throw InvalidParameterException. May throw InvalidNextTokenException. May throw ClientException. May throw ServiceException.

Parameter directoryId : The identifier of the directory for which to retrieve snapshot information.

Parameter limit : The maximum number of objects to return.

Parameter nextToken : The DescribeSnapshotsResult.NextToken value from a previous call to DescribeSnapshots. Pass null if this is the first call.

Parameter snapshotIds : A list of identifiers of the snapshots to obtain the information for. If this member is null or empty, all snapshots are returned using the Limit and NextToken members.

Implementation

Future<DescribeSnapshotsResult> describeSnapshots({
  String? directoryId,
  int? limit,
  String? nextToken,
  List<String>? snapshotIds,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    0,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DirectoryService_20150416.DescribeSnapshots'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (directoryId != null) 'DirectoryId': directoryId,
      if (limit != null) 'Limit': limit,
      if (nextToken != null) 'NextToken': nextToken,
      if (snapshotIds != null) 'SnapshotIds': snapshotIds,
    },
  );

  return DescribeSnapshotsResult.fromJson(jsonResponse.body);
}