This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework DynamoDb API to be typesafe (#28)
- Loading branch information
1 parent
ffa9b92
commit 46baa63
Showing
18 changed files
with
266 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
amazon/dynamodb/client/src/main/kotlin/org/http4k/connect/amazon/dynamodb/action/Scan.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.http4k.connect.amazon.dynamodb.action | ||
|
||
import org.http4k.connect.Http4kConnectAction | ||
import org.http4k.connect.amazon.dynamodb.DynamoDbMoshi | ||
import org.http4k.connect.amazon.model.TableName | ||
import se.ansman.kotshi.JsonSerializable | ||
|
||
@Http4kConnectAction | ||
@JsonSerializable | ||
data class Scan( | ||
val TableName: TableName, | ||
val FilterExpression: String? = null, | ||
val ExpressionAttributeNames: TokensToNames? = null, | ||
val ExpressionAttributeValues: TokensToValues? = null, | ||
val ExclusiveStartKey: ItemAttributes? = null, | ||
val IndexName: String? = null, | ||
val Limit: Int? = null, | ||
val ConsistentRead: Boolean? = null, | ||
val ProjectionExpression: String? = null, | ||
val Segment: Int? = null, | ||
val Select: String? = null, | ||
val TotalSegments: Int? = null, | ||
val ReturnConsumedCapacity: String? = null, | ||
): DynamoDbAction<ScanResponse>(ScanResponse::class, DynamoDbMoshi) | ||
|
||
@JsonSerializable | ||
data class ScanResponse( | ||
val ConsumedCapacity: ConsumedCapacity?, | ||
val Count: Int?, | ||
val LastEvaluatedKey: ItemAttributes?, | ||
val ScannedCount: Int?, | ||
internal val Items: List<ItemResult>? | ||
) { | ||
val items = Items?.map(ItemResult::toItem) ?: emptyList() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.