use of com.google.api.codegen.viewmodel.ApiMethodDocView in project toolkit by googleapis.
the class DynamicLangApiMethodTransformer method generateMethodDoc.
private ApiMethodDocView generateMethodDoc(GapicMethodContext context) {
ApiMethodDocView.Builder docBuilder = ApiMethodDocView.newBuilder();
SurfaceNamer surfaceNamer = context.getNamer();
MethodModel method = context.getMethodModel();
MethodConfig methodConfig = context.getMethodConfig();
docBuilder.mainDocLines(surfaceNamer.getDocLines(method, methodConfig));
docBuilder.paramDocs(apiMethodParamTransformer.generateParamDocs(context));
docBuilder.returnTypeName(surfaceNamer.getDynamicLangReturnTypeName(context));
docBuilder.returnsDocLines(surfaceNamer.getReturnDocLines(context.getSurfaceInterfaceContext(), context, Synchronicity.Sync));
if (methodConfig.isPageStreaming()) {
docBuilder.pageStreamingResourceTypeName(surfaceNamer.getTypeNameDoc(context.getTypeTable(), methodConfig.getPageStreaming().getResourcesField().getType()));
}
docBuilder.throwsDocLines(surfaceNamer.getThrowsDocLines(methodConfig));
return docBuilder.build();
}
Aggregations