Skip to content

Commit

Permalink
Improve client tool constant generation code
Browse files Browse the repository at this point in the history
  • Loading branch information
rashmibharambe authored Oct 8, 2023
1 parent 796bae0 commit 891158d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.HashMap;

import static io.ballerina.protoc.GrpcConstants.ORG_NAME;
import static io.ballerina.protoc.builder.syntaxtree.components.Expression.getCheckExpressionNode;
Expand Down Expand Up @@ -102,8 +102,11 @@ public class ClientSampleSyntaxTreeUtils {
INPUT_TYPE_EXPR_NODES.put("byte[]", getByteArrayLiteralNode("[72,101,108,108,111]"));
INPUT_TYPE_EXPR_NODES.put("time:Utc", getTupleLiteralNode("[1659688553,0.310073000d]"));
INPUT_TYPE_EXPR_NODES.put("time:Seconds", getDecimalLiteralNode("0.310073000d"));
INPUT_TYPE_EXPR_NODES.put("map<anydata>", createBasicLiteralNode(SyntaxKind.MAP_TYPE_DESC, "{message: \"Hello Ballerina\"}"));
INPUT_TYPE_EXPR_NODES.put("'any:Any", getCheckExpressionNode(getFunctionCallExpressionNode("'any", "pack", "\"ballerina\"")));
INPUT_TYPE_EXPR_NODES.put("map<anydata>", createBasicLiteralNode(SyntaxKind.MAP_TYPE_DESC,
"{message: \"Hello Ballerina\"}"));
INPUT_TYPE_EXPR_NODES.put("'any:Any", getCheckExpressionNode(
getFunctionCallExpressionNode("'any", "pack", "\"ballerina\""))
);
}

public static SyntaxTree generateSyntaxTreeForClientSample(ServiceStub serviceStub, String filename,
Expand Down

0 comments on commit 891158d

Please sign in to comment.