use of com.google.api.codegen.viewmodel.metadata.ModuleView in project toolkit by googleapis.
the class RubyGapicSurfaceTransformer method generateModuleViews.
private List<ModuleView> generateModuleViews(ApiModel model, GapicProductConfig productConfig, boolean includeVersionModule) {
SurfaceNamer namer = new RubySurfaceNamer(productConfig.getPackageName());
RubyPackageMetadataTransformer metadataTransformer = new RubyPackageMetadataTransformer(packageConfig);
RubyPackageMetadataNamer packageNamer = new RubyPackageMetadataNamer(productConfig.getPackageName());
ImmutableList.Builder<ModuleView> moduleViews = ImmutableList.builder();
for (String moduleName : namer.getApiModules()) {
if (moduleName.equals(namer.getModuleServiceName())) {
moduleViews.add(metadataTransformer.generateReadmeMetadataView(model, productConfig, packageNamer).moduleName(moduleName).build());
} else if (includeVersionModule || !moduleName.equals(namer.getModuleVersionName())) {
moduleViews.add(SimpleModuleView.newBuilder().moduleName(moduleName).build());
}
}
return moduleViews.build();
}
Aggregations