use of com.google.api.codegen.viewmodel.ModifyMethodView in project toolkit by googleapis.
the class CSharpGapicClientTransformer method generateModifyMethods.
private List<ModifyMethodView> generateModifyMethods(GapicInterfaceContext context) {
SurfaceNamer namer = context.getNamer();
List<ModifyMethodView> modifyMethods = new ArrayList<>();
Set<String> modifyTypeNames = new HashSet<>();
for (MethodModel method : csharpCommonTransformer.getSupportedMethods(context)) {
MethodContext methodContext = context.asRequestMethodContext(method);
String inputTypeFullName = methodContext.getMethodModel().getInputFullName();
if (modifyTypeNames.contains(inputTypeFullName)) {
continue;
}
modifyTypeNames.add(inputTypeFullName);
MethodConfig methodConfig = methodContext.getMethodConfig();
ModifyMethodView.Builder builder = ModifyMethodView.builder();
builder.name(namer.getModifyMethodName(methodContext));
builder.requestTypeName(method.getAndSaveRequestTypeName(context.getImportTypeTable(), context.getNamer()));
builder.grpcStreamingType(methodConfig.getGrpcStreamingType());
modifyMethods.add(builder.build());
}
return modifyMethods;
}
Aggregations