listCertificates method

Future<ListCertificatesResult> listCertificates({
  1. required String directoryId,
  2. int? limit,
  3. String? nextToken,
})

For the specified directory, lists all the certificates registered for a secure LDAP or client certificate authentication.

May throw DirectoryDoesNotExistException. May throw UnsupportedOperationException. May throw InvalidParameterException. May throw InvalidNextTokenException. May throw ClientException. May throw ServiceException.

Parameter directoryId : The identifier of the directory.

Parameter limit : The number of items that should show up on one page

Parameter nextToken : A token for requesting another page of certificates if the NextToken response element indicates that more certificates are available. Use the value of the returned NextToken element in your request until the token comes back as null. Pass null if this is the first call.

Implementation

Future<ListCertificatesResult> listCertificates({
  required String directoryId,
  int? limit,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(directoryId, 'directoryId');
  _s.validateNumRange(
    'limit',
    limit,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DirectoryService_20150416.ListCertificates'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DirectoryId': directoryId,
      if (limit != null) 'Limit': limit,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListCertificatesResult.fromJson(jsonResponse.body);
}