-
-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
amazonka-dynamodb: TransactWriteItem should be a sum type #1006
Comments
Hi @endgame , I took a stab at this. Didn't commit yet, got this far:
The imports in generated modules are completely unnecessary, and removing them by hand gives me a successful --- i/configs/services/dynamodb.json
+++ w/configs/services/dynamodb.json
@@ -10,6 +10,7 @@
],
"typeModules": [
"Amazonka.DynamoDB.Types.AttributeValue",
+ "Amazonka.DynamoDB.Types.TransactWriteItem",
"Amazonka.DynamoDB.Types.WriteRequest"
],
"typeOverrides": {
@@ -40,6 +41,12 @@
"QueryOutput": {
"requiredFields": ["Items"]
},
+ "TransactWriteItem": {
+ "replacedBy": {
+ "name": "TransactWriteItem",
+ "underive": []
+ }
+ },
"WriteRequest": {
"replacedBy": {
"name": "WriteRequest", Any advise?.. The new hand-written module must import Otherwise, I think I'll have enough time to open ~soon a mergeable PR that implements this. The core idea is there: data TransactWriteItem
= ConditionCheck ConditionCheck
| Delete Delete
| Put Put
| Update Update TL;DR: the issue is clear to me; tomorrow I'll open a draft PR that almost-implements it, modulo an other issue with extra imports getting generated that create import cycles. |
It will require changes to the generator, which currently imports all
№1 feels more flexible in general, though for it to work in all cases it would need to know to |
TransactWriteItem
is a product of fourMaybe
s. It should be a sum type likeAttributeValue
, that would be much easier to work with.I think it should be relatively simple and just need a PR similar to #799 or #724 .
Running
scripts/generate --commit dynamodb
will regenerate the service binding.The text was updated successfully, but these errors were encountered: