-
Notifications
You must be signed in to change notification settings - Fork 201
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
Add full Event Stream marshalling support and working S3 example #667
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
making this fields optional feels like a bit of a code smell, probably worth splitting it up to avoid running heterogenous data through this function.
[meta comment on cfbadaf]
aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3Decorator.kt
Outdated
Show resolved
Hide resolved
aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3Decorator.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few small cleanups. Only major thing IIRC was the generic error stuff. Exciting that this operations are working!
codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/RestJson.kt
Outdated
Show resolved
Hide resolved
...ware/amazon/smithy/rust/codegen/smithy/protocols/serialize/EventStreamMarshallerGenerator.kt
Outdated
Show resolved
Hide resolved
...ware/amazon/smithy/rust/codegen/smithy/protocols/serialize/EventStreamMarshallerGenerator.kt
Outdated
Show resolved
Hide resolved
...ware/amazon/smithy/rust/codegen/smithy/protocols/serialize/EventStreamMarshallerGenerator.kt
Outdated
Show resolved
Hide resolved
*codegenScope | ||
) | ||
}, | ||
{ rust("unimplemented!(\"TODO(EventStream): Figure out what to do when there's no payload\")") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like the kind of runtime panic we should be very cautious about since it's not that hard to trigger. Feels like a level of TODO a bit higher than the others we should be very careful not to launch with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case where the target
is the union member, it is required due to the nature of Smithy unions, so it's impossible to reach this unimplemented!
in this case.
So that means this is only reachable for an event struct that has a @eventPayload
annotated member that isn't also @required
(so the builder isn't checking its requiredness). Will start looking into the expected behavior here.
For the models we are allow listing in this PR (Transcribe and S3), this isn't a problem since none of them need to serialize an event with a member annotated with @eventPayload
. It's exclusively in the response events so far.
...kotlin/software/amazon/smithy/rust/codegen/smithy/generators/error/TopLevelErrorGenerator.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Excited to ship this!
) | ||
} | ||
|
||
override fun parseEventStreamGenericError(operationShape: OperationShape): RuntimeType = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice. We can customize this for S3 select to get nice errors at some point.
- open an issue to track
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue opened: #671
Motivation and Context
This is more progress towards #121.
Description
Arc<Mutex<PropertyBag>>
to beSharedPropertyBag
try_recv_initial()
toReceiver
Testing
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.