listObjectParentPaths method
- required String directoryArn,
- required ObjectReference objectReference,
- int? maxResults,
- String? nextToken,
Retrieves all available parent paths for any object type such as node, leaf node, policy node, and index node objects. For more information about objects, see Directory Structure.
Use this API to evaluate all parents for an object. The call returns all
objects from the root of the directory up to the requested object. The API
returns the number of paths based on user-defined MaxResults
,
in case there are multiple paths to the parent. The order of the paths and
nodes returned is consistent among multiple API calls unless the objects
are deleted or moved. Paths not leading to the directory root are ignored
from the target object.
May throw InternalServiceException. May throw InvalidArnException. May throw RetryableConflictException. May throw ValidationException. May throw LimitExceededException. May throw AccessDeniedException. May throw DirectoryNotEnabledException. May throw InvalidNextTokenException. May throw ResourceNotFoundException.
Parameter directoryArn
:
The ARN of the directory to which the parent path applies.
Parameter objectReference
:
The reference that identifies the object whose parent paths are listed.
Parameter maxResults
:
The maximum number of items to be retrieved in a single call. This is an
approximate number.
Parameter nextToken
:
The pagination token.
Implementation
Future<ListObjectParentPathsResponse> listObjectParentPaths({
required String directoryArn,
required ObjectReference objectReference,
int? maxResults,
String? nextToken,
}) async {
ArgumentError.checkNotNull(directoryArn, 'directoryArn');
ArgumentError.checkNotNull(objectReference, 'objectReference');
_s.validateNumRange(
'maxResults',
maxResults,
1,
1152921504606846976,
);
final headers = <String, String>{
'x-amz-data-partition': directoryArn.toString(),
};
final $payload = <String, dynamic>{
'ObjectReference': objectReference,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/amazonclouddirectory/2017-01-11/object/parentpaths',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return ListObjectParentPathsResponse.fromJson(response);
}