getVectors method

Future<GetVectorsOutput> getVectors({
  1. required List<String> keys,
  2. String? indexArn,
  3. String? indexName,
  4. bool? returnData,
  5. bool? returnMetadata,
  6. String? vectorBucketName,
})

Returns vector attributes. To specify the vector index, you can either use both the vector bucket name and the vector index name, or use the vector index Amazon Resource Name (ARN).

Permissions
You must have the s3vectors:GetVectors permission to use this operation.

May throw KmsDisabledException. May throw KmsInvalidKeyUsageException. May throw KmsInvalidStateException. May throw KmsNotFoundException. May throw NotFoundException. May throw ServiceUnavailableException.

Parameter keys : The names of the vectors you want to return attributes for.

Parameter indexArn : The ARN of the vector index.

Parameter indexName : The name of the vector index.

Parameter returnData : Indicates whether to include the vector data in the response. The default value is false.

Parameter returnMetadata : Indicates whether to include metadata in the response. The default value is false.

Parameter vectorBucketName : The name of the vector bucket that contains the vector index.

Implementation

Future<GetVectorsOutput> getVectors({
  required List<String> keys,
  String? indexArn,
  String? indexName,
  bool? returnData,
  bool? returnMetadata,
  String? vectorBucketName,
}) async {
  final $payload = <String, dynamic>{
    'keys': keys,
    if (indexArn != null) 'indexArn': indexArn,
    if (indexName != null) 'indexName': indexName,
    if (returnData != null) 'returnData': returnData,
    if (returnMetadata != null) 'returnMetadata': returnMetadata,
    if (vectorBucketName != null) 'vectorBucketName': vectorBucketName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/GetVectors',
    exceptionFnMap: _exceptionFns,
  );
  return GetVectorsOutput.fromJson(response);
}