use of com.google.api.codegen.viewmodel.GrpcStreamingDetailView in project toolkit by googleapis.
the class NodeJSGapicSurfaceTransformer method createGrpcStreamingDescriptors.
private List<GrpcStreamingDetailView> createGrpcStreamingDescriptors(GapicInterfaceContext context) {
List<GrpcStreamingDetailView> result = new ArrayList<>();
for (MethodModel method : context.getGrpcStreamingMethods()) {
GrpcStreamingConfig grpcStreamingConfig = context.asDynamicMethodContext(method).getMethodConfig().getGrpcStreaming();
String resourcesFieldGetFunction = null;
if (grpcStreamingConfig.hasResourceField()) {
resourcesFieldGetFunction = context.getNamer().getFieldGetFunctionName(grpcStreamingConfig.getResourcesField());
}
result.add(GrpcStreamingDetailView.newBuilder().methodName(context.getNamer().getApiMethodName(method, VisibilityConfig.PUBLIC)).grpcStreamingType(grpcStreamingConfig.getType()).grpcResourcesField(resourcesFieldGetFunction).streamTypeName(context.getNamer().getStreamTypeName(grpcStreamingConfig.getType())).build());
}
return result;
}
use of com.google.api.codegen.viewmodel.GrpcStreamingDetailView in project toolkit by googleapis.
the class PhpGapicSurfaceTransformer method createGrpcStreamingDescriptors.
private List<GrpcStreamingDetailView> createGrpcStreamingDescriptors(GapicInterfaceContext context) {
List<GrpcStreamingDetailView> result = new ArrayList<>();
for (MethodModel method : context.getGrpcStreamingMethods()) {
GrpcStreamingConfig grpcStreamingConfig = context.asDynamicMethodContext(method).getMethodConfig().getGrpcStreaming();
String resourcesFieldGetFunction = null;
if (grpcStreamingConfig.hasResourceField()) {
resourcesFieldGetFunction = context.getNamer().getFieldGetFunctionName(grpcStreamingConfig.getResourcesField());
}
result.add(GrpcStreamingDetailView.newBuilder().methodName(context.getNamer().getApiMethodName(method, VisibilityConfig.PUBLIC)).transportMethodName(context.getNamer().getGrpcMethodName(method)).grpcStreamingType(grpcStreamingConfig.getType()).grpcResourcesField(resourcesFieldGetFunction).build());
}
return result;
}
Aggregations