getObjectInformation method

Future<GetObjectInformationResponse> getObjectInformation({
  1. required String directoryArn,
  2. required ObjectReference objectReference,
  3. ConsistencyLevel? consistencyLevel,
})

Retrieves metadata about an object.

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

Parameter directoryArn : The ARN of the directory being retrieved.

Parameter objectReference : A reference to the object.

Parameter consistencyLevel : The consistency level at which to retrieve the object information.

Implementation

Future<GetObjectInformationResponse> getObjectInformation({
  required String directoryArn,
  required ObjectReference objectReference,
  ConsistencyLevel? consistencyLevel,
}) async {
  ArgumentError.checkNotNull(directoryArn, 'directoryArn');
  ArgumentError.checkNotNull(objectReference, 'objectReference');
  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,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/amazonclouddirectory/2017-01-11/object/information',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return GetObjectInformationResponse.fromJson(response);
}