Search in sources :

Example 1 with SimpleParamDocView

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

the class CSharpApiMethodTransformer method getRequestObjectParamDocs.

@Override
public List<SimpleParamDocView> getRequestObjectParamDocs(MethodContext context) {
    String requestTypeName = context.getMethodModel().getAndSaveRequestTypeName(context.getTypeTable(), context.getNamer());
    switch(context.getMethodConfig().getGrpcStreamingType()) {
        case NonStreaming:
            SimpleParamDocView nonStreamingDoc = SimpleParamDocView.newBuilder().paramName("request").typeName(requestTypeName).lines(ImmutableList.of("The request object containing all of the parameters for the API call.")).build();
            return ImmutableList.of(nonStreamingDoc);
        case ServerStreaming:
            SimpleParamDocView serverStreamingDoc = SimpleParamDocView.newBuilder().paramName("request").typeName(requestTypeName).lines(ImmutableList.of("The request object containing all of the parameters for the API call.")).build();
            SimpleParamDocView serverStreamingCallSettingsDoc = SimpleParamDocView.newBuilder().paramName("callSettings").typeName("CallSettings").lines(ImmutableList.of("If not null, applies overrides to this RPC call.")).build();
            return ImmutableList.of(serverStreamingDoc, serverStreamingCallSettingsDoc);
        case BidiStreaming:
            SimpleParamDocView bidiStreamingCallSettingsDoc = SimpleParamDocView.newBuilder().paramName("callSettings").typeName("CallSettings").lines(ImmutableList.of("If not null, applies overrides to this RPC call.")).build();
            SimpleParamDocView bidiStreamingSettingsDoc = SimpleParamDocView.newBuilder().paramName("streamingSettings").typeName("BidirectionalStreamingSettings").lines(ImmutableList.of("If not null, applies streaming overrides to this RPC call.")).build();
            return ImmutableList.of(bidiStreamingCallSettingsDoc, bidiStreamingSettingsDoc);
        default:
            throw new UnsupportedOperationException("Cannot handle streaming type: " + context.getMethodConfig().getGrpcStreamingType());
    }
}
Also used : SimpleParamDocView(com.google.api.codegen.viewmodel.SimpleParamDocView)

Example 2 with SimpleParamDocView

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

the class StaticLangApiMethodTransformer method getRequestObjectParamDocs.

public List<SimpleParamDocView> getRequestObjectParamDocs(MethodContext context) {
    MethodModel method = context.getMethodModel();
    SimpleParamDocView doc = SimpleParamDocView.newBuilder().paramName("request").typeName(method.getAndSaveRequestTypeName(context.getTypeTable(), context.getNamer())).lines(Arrays.<String>asList("The request object containing all of the parameters for the API call.")).build();
    return ImmutableList.of(doc);
}
Also used : MethodModel(com.google.api.codegen.config.MethodModel) SimpleParamDocView(com.google.api.codegen.viewmodel.SimpleParamDocView)

Aggregations

SimpleParamDocView (com.google.api.codegen.viewmodel.SimpleParamDocView)2 MethodModel (com.google.api.codegen.config.MethodModel)1