attachToIndex method

Future<AttachToIndexResponse> attachToIndex({
  1. required String directoryArn,
  2. required ObjectReference indexReference,
  3. required ObjectReference targetReference,
})

Attaches the specified object to the specified index.

May throw AccessDeniedException. May throw DirectoryNotEnabledException. May throw IndexedAttributeMissingException. May throw InternalServiceException. May throw InvalidArnException. May throw InvalidAttachmentException. May throw LimitExceededException. May throw LinkNameAlreadyInUseException. May throw NotIndexException. May throw ResourceNotFoundException. May throw RetryableConflictException. May throw ValidationException.

Parameter directoryArn : The Amazon Resource Name (ARN) of the directory where the object and index exist.

Parameter indexReference : A reference to the index that you are attaching the object to.

Parameter targetReference : A reference to the object that you are attaching to the index.

Implementation

Future<AttachToIndexResponse> attachToIndex({
  required String directoryArn,
  required ObjectReference indexReference,
  required ObjectReference targetReference,
}) async {
  final headers = <String, String>{
    'x-amz-data-partition': directoryArn.toString(),
  };
  final $payload = <String, dynamic>{
    'IndexReference': indexReference,
    'TargetReference': targetReference,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/amazonclouddirectory/2017-01-11/index/attach',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return AttachToIndexResponse.fromJson(response);
}