attachObject method
Attaches an existing object to another object. An object can be accessed in two ways:
- Using the path
-
Using
ObjectIdentifier
May throw AccessDeniedException.
May throw DirectoryNotEnabledException.
May throw FacetValidationException.
May throw InternalServiceException.
May throw InvalidArnException.
May throw InvalidAttachmentException.
May throw LimitExceededException.
May throw LinkNameAlreadyInUseException.
May throw ResourceNotFoundException.
May throw RetryableConflictException.
May throw ValidationException.
Parameter childReference :
The child object reference to be attached to the object.
Parameter directoryArn :
Amazon Resource Name (ARN) that is associated with the Directory
where both objects reside. For more information, see arns.
Parameter linkName :
The link name with which the child object is attached to the parent.
Parameter parentReference :
The parent object reference.
Implementation
Future<AttachObjectResponse> attachObject({
required ObjectReference childReference,
required String directoryArn,
required String linkName,
required ObjectReference parentReference,
}) async {
final headers = <String, String>{
'x-amz-data-partition': directoryArn.toString(),
};
final $payload = <String, dynamic>{
'ChildReference': childReference,
'LinkName': linkName,
'ParentReference': parentReference,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/amazonclouddirectory/2017-01-11/object/attach',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return AttachObjectResponse.fromJson(response);
}