Skip to content

Commit e15ffcf

Browse files
author
AWS SDK for Go v2 automation user
committed
Merge customizations for SageMaker Runtime HTTP2
1 parent 69a6df8 commit e15ffcf

File tree

3 files changed

+40
-26
lines changed

3 files changed

+40
-26
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package software.amazon.smithy.aws.go.codegen.customization;
2+
3+
import java.util.List;
4+
import java.util.Locale;
5+
import java.util.Map;
6+
7+
import software.amazon.smithy.aws.traits.ServiceTrait;
8+
import software.amazon.smithy.go.codegen.GoSettings;
9+
import software.amazon.smithy.go.codegen.integration.GoIntegration;
10+
import software.amazon.smithy.model.Model;
11+
import software.amazon.smithy.model.shapes.ShapeId;
12+
13+
public class RemoveOperations implements GoIntegration {
14+
15+
private Map<String, List<ShapeId>> SHAPES_TO_REMOVE = Map.of(
16+
"bedrock runtime", List.of(
17+
ShapeId.from("com.amazonaws.bedrockruntime#InvokeModelWithBidirectionalStream"),
18+
ShapeId.from("com.amazonaws.bedrockruntime#InvokeModelWithBidirectionalStreamRequest"),
19+
ShapeId.from("com.amazonaws.bedrockruntime#InvokeModelWithBidirectionalStreamResponse")
20+
),
21+
"sagemaker runtime http2", List.of(
22+
ShapeId.from("com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStream"),
23+
ShapeId.from("com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamInput"),
24+
ShapeId.from("com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamOutput")
25+
)
26+
);
27+
28+
@Override
29+
public Model preprocessModel(Model model, GoSettings settings) {
30+
String sdkId = settings.getService(model).expectTrait(ServiceTrait.class).getSdkId();
31+
List<ShapeId> serviceShapes = SHAPES_TO_REMOVE.get(sdkId.toLowerCase(Locale.ROOT));
32+
if (serviceShapes != null) {
33+
for (ShapeId shapeId : serviceShapes) {
34+
model = model.toBuilder().removeShape(shapeId).build();
35+
}
36+
}
37+
return model;
38+
}
39+
}

codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/service/bedrockruntime/RemoveOperations.java

Lines changed: 0 additions & 25 deletions
This file was deleted.

codegen/smithy-aws-go-codegen/src/main/resources/META-INF/services/software.amazon.smithy.go.codegen.integration.GoIntegration

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ software.amazon.smithy.aws.go.codegen.customization.ChecksumMetricsTracking
9090
software.amazon.smithy.aws.go.codegen.customization.AccountIdEndpointModeUserAgent
9191
software.amazon.smithy.aws.go.codegen.CredentialSourceFeatureTrackerGenerator
9292
software.amazon.smithy.aws.go.codegen.customization.SraOperationOrderTest
93-
software.amazon.smithy.aws.go.codegen.customization.service.bedrockruntime.RemoveOperations
93+
software.amazon.smithy.aws.go.codegen.customization.RemoveOperations
9494
software.amazon.smithy.aws.go.codegen.customization.RetryInterceptors
9595
software.amazon.smithy.aws.go.codegen.customization.service.BearerTokenEnvProvider

0 commit comments

Comments
 (0)