KeyType
A key value for a table or index.
Keys in DynamoDB may consist of 1, 2, 3, or 4 attributes. This type exists to provide a uniform interface over keys of any cardinality to use in GetItem, Query, and other operations which operate on keys. Where possible, convenience methods are added to simplify the most common pattern of a single key attribute.
A KeyType consisting of a single attribute value may be created with the Key factory function. A KeyType consisting of additional attribute values may be created by invoking the one of the invoke extension function overloads.
Important: The order of attribute values within a KeyType is significant and must reflect the order of the attributes defined in the table or index key within DynamoDB as well as related KeySpec instances for the same table/index.
Examples
To create a key value for a single attribute:
val keyValue = Key(42) // returns KeyType.Key1<Int>To create a key specification for multiple attributes:
val keyValue = Key(42)("ABCD")(1000L) // returns KeyType.Key3<Int, String, Long>