Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,30 @@ private String getStreamingBlobOutputAddendum() {
return streamingBlobAddendum;
}

private String getReadStreamExample() {
String streamingBlobOutputMemberName = model.expectShape(operation.getOutputShape())
.asStructureShape().get()
.getAllMembers()
.values()
.stream()
.filter(ms -> {
Shape target = model.expectShape(ms.getTarget());
return target.isBlobShape()
&& (ms.hasTrait(StreamingTrait.class) || target.hasTrait(StreamingTrait.class));
})
.findFirst()
.map(MemberShape::getMemberName)
.orElse("");

if (!streamingBlobOutputMemberName.isEmpty()) {
return """
// Read the stream or discard it to free the socket.
const bytes = await response[`%s`].transformToByteArray();\n"""
.formatted(streamingBlobOutputMemberName);
}
return "";
}

private String getThrownExceptions() {
List<ShapeId> errors = operation.getErrors();
StringBuilder buffer = new StringBuilder();
Expand Down