Skip to content

Commit d264c9f

Browse files
committed
revert git changes
1 parent a06a85f commit d264c9f

File tree

3 files changed

+5
-24
lines changed

3 files changed

+5
-24
lines changed

codegen/aws/core/src/main/java/software/amazon/smithy/python/aws/codegen/AwsRstDocFileGenerator.java

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77
import static software.amazon.smithy.python.codegen.SymbolProperties.OPERATION_METHOD;
88

99
import java.util.List;
10-
import java.util.Optional;
11-
1210
import software.amazon.smithy.model.traits.InputTrait;
1311
import software.amazon.smithy.model.traits.OutputTrait;
14-
import software.amazon.smithy.model.traits.StreamingTrait;
1512
import software.amazon.smithy.python.codegen.GenerationContext;
1613
import software.amazon.smithy.python.codegen.integrations.PythonIntegration;
1714
import software.amazon.smithy.python.codegen.sections.*;
@@ -87,14 +84,7 @@ public void append(PythonWriter pythonWriter, OperationSection section) {
8784
fileWriter.write("=================\nInput:\n=================\n\n");
8885
fileWriter.write(".. autoclass:: " + inputSymbolName + "\n :members:\n");
8986
fileWriter.write("=================\nOutput:\n=================\n\n");
90-
if (section.isStream()) {
91-
var streamShape =
92-
context.model().expectShape(output.getAllMembers().get("stream").getId());
93-
var streamName = context.symbolProvider().toSymbol(streamShape).toString();
94-
fileWriter.write(".. autodata:: " + streamName + " \n\n");
95-
} else {
96-
fileWriter.write(".. autoclass:: " + outputSymbolName + "\n " + ":members:\n\n");
97-
}
87+
fileWriter.write(".. autoclass:: " + outputSymbolName + "\n :members:\n");
9888
});
9989
}
10090
}
@@ -119,15 +109,7 @@ public void append(PythonWriter pythonWriter, StructureSection section) {
119109
var symbol = context.symbolProvider().toSymbol(shape);
120110
String docsFileName = String.format("docs/models/%s.rst",
121111
symbol.getName());
122-
123-
boolean isStreaming = Optional.ofNullable(shape.getAllMembers().get("body"))
124-
.map(member -> context.model().expectShape(member.getTarget()))
125-
.map(memberShape -> memberShape.hasTrait(StreamingTrait.class))
126-
.orElse(false);
127-
// Input and output shapes are typically skipped since they are generated
128-
// on the operation's page. The exception to this is the output of
129-
// streaming operations where we have a different output shape defined.
130-
if (!shape.hasTrait(InputTrait.class) && !shape.hasTrait(OutputTrait.class) || isStreaming) {
112+
if (!shape.hasTrait(InputTrait.class) && !shape.hasTrait(OutputTrait.class)) {
131113
context.writerDelegator().useFileWriter(docsFileName, "", writer -> {
132114
writer.write(generateHeader(symbol.getName()));
133115
writer.write(".. autoclass:: " + symbol.toString() + "\n :members:\n");

codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ private void generateOperation(PythonWriter writer, OperationShape operation) {
830830
var output = model.expectShape(operation.getOutputShape());
831831
var outputSymbol = symbolProvider.toSymbol(output);
832832

833-
writer.pushState(new OperationSection(service, operation, false));
833+
writer.pushState(new OperationSection(service, operation));
834834
writer.openBlock("async def $L(self, input: $T, plugins: list[$T] | None = None) -> $T:",
835835
"",
836836
operationMethodSymbol.getName(),
@@ -905,7 +905,7 @@ private void writeSharedOperationInit(PythonWriter writer, OperationShape operat
905905
}
906906

907907
private void generateEventStreamOperation(PythonWriter writer, OperationShape operation) {
908-
writer.pushState(new OperationSection(service, operation, true));
908+
writer.pushState(new OperationSection(service, operation));
909909
writer.addDependency(SmithyPythonDependency.SMITHY_CORE);
910910
var operationSymbol = symbolProvider.toSymbol(operation);
911911
writer.putContext("operation", operationSymbol);

codegen/core/src/main/java/software/amazon/smithy/python/codegen/sections/OperationSection.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
* A section that controls writing an operation.
1414
*/
1515
@SmithyInternalApi
16-
public record OperationSection(Shape service, OperationShape operation,
17-
boolean isStream) implements CodeSection {}
16+
public record OperationSection(Shape service, OperationShape operation) implements CodeSection {}

0 commit comments

Comments
 (0)