describeDocumentVersions method

Future<DescribeDocumentVersionsResponse> describeDocumentVersions({
  1. required String documentId,
  2. String? authenticationToken,
  3. String? fields,
  4. String? include,
  5. int? limit,
  6. String? marker,
})

Retrieves the document versions for the specified document.

By default, only active versions are returned.

May throw EntityNotExistsException. May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException. May throw InvalidArgumentException. May throw FailedDependencyException. May throw ServiceUnavailableException. May throw ProhibitedStateException.

Parameter documentId : The ID of the document.

Parameter authenticationToken : Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

Parameter fields : Specify "SOURCE" to include initialized versions and a URL for the source document.

Parameter include : A comma-separated list of values. Specify "INITIALIZED" to include incomplete versions.

Parameter limit : The maximum number of versions to return with this call.

Parameter marker : The marker for the next set of results. (You received this marker from a previous call.)

Implementation

Future<DescribeDocumentVersionsResponse> describeDocumentVersions({
  required String documentId,
  String? authenticationToken,
  String? fields,
  String? include,
  int? limit,
  String? marker,
}) async {
  ArgumentError.checkNotNull(documentId, 'documentId');
  _s.validateStringLength(
    'documentId',
    documentId,
    1,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'authenticationToken',
    authenticationToken,
    1,
    8199,
  );
  _s.validateStringLength(
    'fields',
    fields,
    1,
    256,
  );
  _s.validateStringLength(
    'include',
    include,
    1,
    256,
  );
  _s.validateNumRange(
    'limit',
    limit,
    1,
    999,
  );
  _s.validateStringLength(
    'marker',
    marker,
    1,
    2048,
  );
  final headers = <String, String>{
    if (authenticationToken != null)
      'Authentication': authenticationToken.toString(),
  };
  final $query = <String, List<String>>{
    if (fields != null) 'fields': [fields],
    if (include != null) 'include': [include],
    if (limit != null) 'limit': [limit.toString()],
    if (marker != null) 'marker': [marker],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/api/v1/documents/${Uri.encodeComponent(documentId)}/versions',
    queryParams: $query,
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return DescribeDocumentVersionsResponse.fromJson(response);
}