Search in sources :

Example 1 with ProtoFileView

use of com.google.api.codegen.ProtoFileView in project toolkit by googleapis.

the class NodeJSGapicSurfaceDocTransformer method transform.

@Override
public List<ViewModel> transform(ApiModel apiModel, GapicProductConfig productConfig) {
    Model model = ((ProtoApiModel) apiModel).getProtoModel();
    ImmutableList.Builder<ViewModel> surfaceDocs = ImmutableList.builder();
    for (ProtoFile file : new ProtoFileView().getElementIterable(model)) {
        surfaceDocs.add(generateDoc(file, productConfig));
    }
    return surfaceDocs.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) ProtoFileView(com.google.api.codegen.ProtoFileView) ProtoApiModel(com.google.api.codegen.config.ProtoApiModel) ApiModel(com.google.api.codegen.config.ApiModel) ViewModel(com.google.api.codegen.viewmodel.ViewModel) Model(com.google.api.tools.framework.model.Model) ProtoFile(com.google.api.tools.framework.model.ProtoFile) ProtoApiModel(com.google.api.codegen.config.ProtoApiModel) ViewModel(com.google.api.codegen.viewmodel.ViewModel)

Example 2 with ProtoFileView

use of com.google.api.codegen.ProtoFileView in project toolkit by googleapis.

the class RubyGapicSurfaceDocTransformer method transform.

@Override
public List<ViewModel> transform(ApiModel model, GapicProductConfig productConfig) {
    ImmutableList.Builder<ViewModel> surfaceDocs = ImmutableList.builder();
    for (ProtoFile file : new ProtoFileView().getElementIterable(((ProtoApiModel) model).getProtoModel())) {
        surfaceDocs.add(generateDoc(file, productConfig));
    }
    surfaceDocs.add(generateOverview(model, productConfig));
    return surfaceDocs.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) ProtoFileView(com.google.api.codegen.ProtoFileView) ProtoFile(com.google.api.tools.framework.model.ProtoFile) ViewModel(com.google.api.codegen.viewmodel.ViewModel)

Aggregations

ProtoFileView (com.google.api.codegen.ProtoFileView)2 ViewModel (com.google.api.codegen.viewmodel.ViewModel)2 ProtoFile (com.google.api.tools.framework.model.ProtoFile)2 ImmutableList (com.google.common.collect.ImmutableList)2 ApiModel (com.google.api.codegen.config.ApiModel)1 ProtoApiModel (com.google.api.codegen.config.ProtoApiModel)1 Model (com.google.api.tools.framework.model.Model)1