Skip to content

Commit

Permalink
chore(codegen): populate requestAlgorithmMember object
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Nov 26, 2024
1 parent f7800dd commit 34ba890
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,19 @@ private static Map<String, Object> getPluginFunctionParams(
HttpChecksumTrait httpChecksumTrait = operation.expectTrait(HttpChecksumTrait.class);
params.put("requestChecksumRequired", httpChecksumTrait.isRequestChecksumRequired());
httpChecksumTrait.getRequestAlgorithmMember().ifPresent(requestAlgorithmMember -> {
params.put("requestAlgorithmMember", requestAlgorithmMember);
Map<String, String> requestAlgorithmMemberMap = new TreeMap<String, String>();
requestAlgorithmMemberMap.put("name", requestAlgorithmMember);

// We know that input shape is structure, and contains requestAlgorithmMember.
StructureShape inputShape = model.expectShape(operation.getInput().get(), StructureShape.class);
MemberShape requestAlgorithmMemberShape = inputShape.getAllMembers().get(requestAlgorithmMember);

// Set requestAlgorithmMemberHttpHeader if HttpHeaderTrait is present.
requestAlgorithmMemberShape.getTrait(HttpHeaderTrait.class).ifPresent(httpHeaderTrait -> {
params.put("requestAlgorithmMemberHttpHeader", httpHeaderTrait.getValue());
requestAlgorithmMemberMap.put("httpHeader", httpHeaderTrait.getValue());
});

params.put("requestAlgorithmMember", requestAlgorithmMemberMap);
});
httpChecksumTrait.getRequestValidationModeMember().ifPresent(requestValidationModeMember -> {
params.put("requestValidationModeMember", requestValidationModeMember);
Expand Down

0 comments on commit 34ba890

Please sign in to comment.