listObjectParents method

Future<ListObjectParentsResponse> listObjectParents({
  1. required String directoryArn,
  2. required ObjectReference objectReference,
  3. ConsistencyLevel? consistencyLevel,
  4. bool? includeAllLinksToEachParent,
  5. int? maxResults,
  6. String? nextToken,
})

Lists parent objects that are associated with a given object in pagination fashion.

May throw InternalServiceException. May throw InvalidArnException. May throw RetryableConflictException. May throw ValidationException. May throw LimitExceededException. May throw AccessDeniedException. May throw DirectoryNotEnabledException. May throw ResourceNotFoundException. May throw InvalidNextTokenException. May throw CannotListParentOfRootException.

Parameter directoryArn : The Amazon Resource Name (ARN) that is associated with the Directory where the object resides. For more information, see arns.

Parameter objectReference : The reference that identifies the object for which parent objects are being listed.

Parameter consistencyLevel : Represents the manner and timing in which the successful write or update of an object is reflected in a subsequent read operation of that same object.

Parameter includeAllLinksToEachParent : When set to True, returns all ListObjectParentsResponse$ParentLinks. There could be multiple links between a parent-child pair.

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<ListObjectParentsResponse> listObjectParents({
  required String directoryArn,
  required ObjectReference objectReference,
  ConsistencyLevel? consistencyLevel,
  bool? includeAllLinksToEachParent,
  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(),
    if (consistencyLevel != null)
      'x-amz-consistency-level': consistencyLevel.toValue(),
  };
  final $payload = <String, dynamic>{
    'ObjectReference': objectReference,
    if (includeAllLinksToEachParent != null)
      'IncludeAllLinksToEachParent': includeAllLinksToEachParent,
    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/parent',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return ListObjectParentsResponse.fromJson(response);
}