Search in sources :

Example 1 with ModuleView

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();
}
Also used : ModuleView(com.google.api.codegen.viewmodel.metadata.ModuleView) SimpleModuleView(com.google.api.codegen.viewmodel.metadata.SimpleModuleView) ImmutableList(com.google.common.collect.ImmutableList) SurfaceNamer(com.google.api.codegen.transformer.SurfaceNamer)

Aggregations

SurfaceNamer (com.google.api.codegen.transformer.SurfaceNamer)1 ModuleView (com.google.api.codegen.viewmodel.metadata.ModuleView)1 SimpleModuleView (com.google.api.codegen.viewmodel.metadata.SimpleModuleView)1 ImmutableList (com.google.common.collect.ImmutableList)1