use of com.google.api.codegen.viewmodel.metadata.TocContentView in project toolkit by googleapis.
the class RubyGapicSurfaceDocTransformer method generateTocModuleView.
private TocModuleView generateTocModuleView(ApiModel model, ProtoFile file, ProductConfig productConfig, SurfaceNamer namer, String moduleName) {
RubyPackageMetadataTransformer metadataTransformer = new RubyPackageMetadataTransformer(packageConfig);
RubyPackageMetadataNamer packageNamer = new RubyPackageMetadataNamer(productConfig.getPackageName());
String packageFilePath = file.getFullName().replace(".", File.separator);
ImmutableList.Builder<TocContentView> tocContents = ImmutableList.builder();
for (Interface apiInterface : file.getReachableInterfaces()) {
String description = RubyUtil.getSentence(namer.getDocLines(GapicParser.getDocString(apiInterface)));
InterfaceConfig interfaceConfig = productConfig.getInterfaceConfig(new ProtoInterfaceModel(apiInterface));
tocContents.add(metadataTransformer.generateTocContent(description, packageNamer, packageFilePath, namer.getApiWrapperClassName(interfaceConfig)));
}
tocContents.add(metadataTransformer.generateTocContent("Data types for " + productConfig.getPackageName(), packageNamer, packageFilePath, "Data Types"));
return TocModuleView.newBuilder().moduleName(moduleName).fullName(model.getTitle()).contents(tocContents.build()).build();
}
Aggregations