Search in sources :

Example 1 with ApiMethodDocView

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();
}
Also used : MethodConfig(com.google.api.codegen.config.MethodConfig) MethodModel(com.google.api.codegen.config.MethodModel) ApiMethodDocView(com.google.api.codegen.viewmodel.ApiMethodDocView)

Aggregations

MethodConfig (com.google.api.codegen.config.MethodConfig)1 MethodModel (com.google.api.codegen.config.MethodModel)1 ApiMethodDocView (com.google.api.codegen.viewmodel.ApiMethodDocView)1