attachTypedLink method

Future<AttachTypedLinkResponse> attachTypedLink({
  1. required List<AttributeNameAndValue> attributes,
  2. required String directoryArn,
  3. required ObjectReference sourceObjectReference,
  4. required ObjectReference targetObjectReference,
  5. required TypedLinkSchemaAndFacetName typedLinkFacet,
})

Attaches a typed link to a specified source and target object. For more information, see Typed link.

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 InvalidAttachmentException. May throw ValidationException. May throw FacetValidationException.

Parameter attributes : A set of attributes that are associated with the typed link.

Parameter directoryArn : The Amazon Resource Name (ARN) of the directory where you want to attach the typed link.

Parameter sourceObjectReference : Identifies the source object that the typed link will attach to.

Parameter targetObjectReference : Identifies the target object that the typed link will attach to.

Parameter typedLinkFacet : Identifies the typed link facet that is associated with the typed link.

Implementation

Future<AttachTypedLinkResponse> attachTypedLink({
  required List<AttributeNameAndValue> attributes,
  required String directoryArn,
  required ObjectReference sourceObjectReference,
  required ObjectReference targetObjectReference,
  required TypedLinkSchemaAndFacetName typedLinkFacet,
}) async {
  ArgumentError.checkNotNull(attributes, 'attributes');
  ArgumentError.checkNotNull(directoryArn, 'directoryArn');
  ArgumentError.checkNotNull(sourceObjectReference, 'sourceObjectReference');
  ArgumentError.checkNotNull(targetObjectReference, 'targetObjectReference');
  ArgumentError.checkNotNull(typedLinkFacet, 'typedLinkFacet');
  final headers = <String, String>{
    'x-amz-data-partition': directoryArn.toString(),
  };
  final $payload = <String, dynamic>{
    'Attributes': attributes,
    'SourceObjectReference': sourceObjectReference,
    'TargetObjectReference': targetObjectReference,
    'TypedLinkFacet': typedLinkFacet,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/amazonclouddirectory/2017-01-11/typedlink/attach',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return AttachTypedLinkResponse.fromJson(response);
}