use of com.google.api.codegen.config.MethodConfig in project toolkit by googleapis.
the class RubySurfaceNamer method getDynamicLangReturnTypeName.
@Override
public String getDynamicLangReturnTypeName(MethodContext methodContext) {
MethodModel method = methodContext.getMethodModel();
MethodConfig methodConfig = methodContext.getMethodConfig();
if (method.isOutputTypeEmpty()) {
return "";
}
String classInfo = method.getOutputTypeName(methodContext.getTypeTable()).getFullName();
if (method.getResponseStreaming()) {
return "Enumerable<" + classInfo + ">";
}
if (methodConfig.isPageStreaming()) {
String resourceTypeName = getModelTypeFormatter().getFullNameForElementType(methodConfig.getPageStreaming().getResourcesField());
return "Google::Gax::PagedEnumerable<" + resourceTypeName + ">";
}
if (methodConfig.isLongRunningOperation()) {
return "Google::Gax::Operation";
}
return classInfo;
}
Aggregations