attachObject method

Future<AttachObjectResponse> attachObject({
  1. required ObjectReference childReference,
  2. required String directoryArn,
  3. required String linkName,
  4. required ObjectReference parentReference,
})

Attaches an existing object to another object. An object can be accessed in two ways:

  1. Using the path
  2. 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);
}