use of com.google.api.codegen.configgen.nodes.ListItemConfigNode in project toolkit by googleapis.
the class CollectionMerger method generateCollectionNode.
private ConfigNode generateCollectionNode(int startLine, String namePattern, String entityName) {
ConfigNode collectionNode = new ListItemConfigNode(startLine);
ConfigNode namePatternNode = FieldConfigNode.createStringPair(collectionNode.getStartLine(), "name_pattern", namePattern);
collectionNode.setChild(namePatternNode);
ConfigNode entityNameNode = FieldConfigNode.createStringPair(NodeFinder.getNextLine(namePatternNode), "entity_name", entityName);
namePatternNode.insertNext(entityNameNode);
return collectionNode;
}
use of com.google.api.codegen.configgen.nodes.ListItemConfigNode in project toolkit by googleapis.
the class MethodMerger method generateFlatteningNode.
private ConfigNode generateFlatteningNode(ConfigNode prevNode, List<String> parameterList) {
ConfigNode flatteningNode = new FieldConfigNode(NodeFinder.getNextLine(prevNode), "flattening").setComment(new FixmeComment("Configure which groups of fields should be flattened into method params."));
prevNode.insertNext(flatteningNode);
ConfigNode flatteningGroupsNode = new FieldConfigNode(NodeFinder.getNextLine(flatteningNode), "groups");
flatteningNode.setChild(flatteningGroupsNode);
ConfigNode groupNode = new ListItemConfigNode(NodeFinder.getNextLine(flatteningGroupsNode));
flatteningGroupsNode.setChild(groupNode);
ConfigNode parametersNode = new FieldConfigNode(groupNode.getStartLine(), "parameters");
groupNode.setChild(parametersNode);
ListTransformer.generateStringList(parameterList, parametersNode);
return flatteningNode;
}
use of com.google.api.codegen.configgen.nodes.ListItemConfigNode in project toolkit by googleapis.
the class MethodMerger method generateMethodNode.
private ListItemConfigNode generateMethodNode(int startLine, MethodModel method, Map<String, String> collectionNameMap) {
ListItemConfigNode methodNode = new ListItemConfigNode(startLine);
ConfigNode nameNode = FieldConfigNode.createStringPair(startLine, "name", method.getSimpleName());
methodNode.setChild(nameNode);
ConfigNode prevNode = generateField(nameNode, method);
prevNode = pageStreamingMerger.generatePageStreamingNode(prevNode, method);
prevNode = retryMerger.generateRetryNamesNode(prevNode, method);
prevNode = generateFieldNamePatterns(prevNode, method, collectionNameMap);
generateTimeout(prevNode, method);
return methodNode;
}
Aggregations