Search in sources :

Example 1 with GrpcEnumValueDocView

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

the class GrpcElementDocTransformer method generateEnumValueDocs.

private List<GrpcEnumValueDocView> generateEnumValueDocs(SurfaceNamer namer, EnumType enumElement) {
    ImmutableList.Builder<GrpcEnumValueDocView> valueDocs = ImmutableList.builder();
    for (EnumValue value : enumElement.getValues()) {
        GrpcEnumValueDocView.Builder doc = GrpcEnumValueDocView.newBuilder();
        doc.name(value.getSimpleName());
        doc.number(value.getNumber());
        doc.lines(namer.getDocLines(GapicParser.getDocString(value)));
        valueDocs.add(doc.build());
    }
    return valueDocs.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) EnumValue(com.google.api.tools.framework.model.EnumValue) GrpcEnumValueDocView(com.google.api.codegen.viewmodel.GrpcEnumValueDocView)

Aggregations

GrpcEnumValueDocView (com.google.api.codegen.viewmodel.GrpcEnumValueDocView)1 EnumValue (com.google.api.tools.framework.model.EnumValue)1 ImmutableList (com.google.common.collect.ImmutableList)1