getDocumentPath method
Retrieves the path information (the hierarchy from the root folder) for the requested document.
By default, Amazon WorkDocs returns a maximum of 100 levels upwards from the requested document and only includes the IDs of the parent folders in the path. You can limit the maximum number of levels. You can also request the names of the parent folders.
May throw EntityNotExistsException. May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException. May throw FailedDependencyException. May throw ServiceUnavailableException.
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
:
A comma-separated list of values. Specify NAME
to include the
names of the parent folders.
Parameter limit
:
The maximum number of levels in the hierarchy to return.
Parameter marker
:
This value is not supported.
Implementation
Future<GetDocumentPathResponse> getDocumentPath({
required String documentId,
String? authenticationToken,
String? fields,
int? limit,
String? marker,
}) async {
ArgumentError.checkNotNull(documentId, 'documentId');
_s.validateStringLength(
'documentId',
documentId,
1,
256,
isRequired: true,
);
_s.validateStringLength(
'authenticationToken',
authenticationToken,
1,
8199,
);
_s.validateStringLength(
'fields',
fields,
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 (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)}/path',
queryParams: $query,
headers: headers,
exceptionFnMap: _exceptionFns,
);
return GetDocumentPathResponse.fromJson(response);
}