listAdapterVersions method

Future<ListAdapterVersionsResponse> listAdapterVersions({
  1. String? adapterId,
  2. DateTime? afterCreationTime,
  3. DateTime? beforeCreationTime,
  4. int? maxResults,
  5. String? nextToken,
})

List all version of an adapter that meet the specified filtration criteria.

May throw AccessDeniedException. May throw InternalServerError. May throw InvalidParameterException. May throw ProvisionedThroughputExceededException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter adapterId : A string containing a unique ID for the adapter to match for when listing adapter versions.

Parameter afterCreationTime : Specifies the lower bound for the ListAdapterVersions operation. Ensures ListAdapterVersions returns only adapter versions created after the specified creation time.

Parameter beforeCreationTime : Specifies the upper bound for the ListAdapterVersions operation. Ensures ListAdapterVersions returns only adapter versions created after the specified creation time.

Parameter maxResults : The maximum number of results to return when listing adapter versions.

Parameter nextToken : Identifies the next page of results to return when listing adapter versions.

Implementation

Future<ListAdapterVersionsResponse> listAdapterVersions({
  String? adapterId,
  DateTime? afterCreationTime,
  DateTime? beforeCreationTime,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Textract.ListAdapterVersions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (adapterId != null) 'AdapterId': adapterId,
      if (afterCreationTime != null)
        'AfterCreationTime': unixTimestampToJson(afterCreationTime),
      if (beforeCreationTime != null)
        'BeforeCreationTime': unixTimestampToJson(beforeCreationTime),
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListAdapterVersionsResponse.fromJson(jsonResponse.body);
}