use of com.google.api.codegen.viewmodel.StaticLangPagedResponseView in project toolkit by googleapis.
the class JavaSurfaceTransformer method generatePagedResponseWrapper.
private StaticLangPagedResponseView generatePagedResponseWrapper(MethodContext context, ImportTypeTable typeTable) {
MethodModel method = context.getMethodModel();
FieldModel resourceField = context.getMethodConfig().getPageStreaming().getResourcesField();
StaticLangPagedResponseView.Builder pagedResponseWrapper = StaticLangPagedResponseView.newBuilder();
String pagedResponseTypeName = context.getNamer().getPagedResponseTypeInnerName(method, typeTable, resourceField);
pagedResponseWrapper.pagedResponseTypeName(pagedResponseTypeName);
pagedResponseWrapper.pageTypeName(context.getNamer().getPageTypeInnerName(method, typeTable, resourceField));
pagedResponseWrapper.fixedSizeCollectionTypeName(context.getNamer().getFixedSizeCollectionTypeInnerName(method, typeTable, resourceField));
pagedResponseWrapper.requestTypeName(method.getAndSaveRequestTypeName(context.getTypeTable(), context.getNamer()));
pagedResponseWrapper.responseTypeName(method.getAndSaveResponseTypeName(context.getTypeTable(), context.getNamer()));
pagedResponseWrapper.resourceTypeName(typeTable.getAndSaveNicknameForElementType(resourceField));
pagedResponseWrapper.iterateMethods(getIterateMethods(context));
return pagedResponseWrapper.build();
}
use of com.google.api.codegen.viewmodel.StaticLangPagedResponseView in project toolkit by googleapis.
the class JavaSurfaceTransformer method generatePagedResponseWrappers.
private List<StaticLangPagedResponseView> generatePagedResponseWrappers(InterfaceContext context, GapicProductConfig productConfig, ReleaseLevel releaseLevel) {
addPagedResponseWrapperImports(context.getImportTypeTable());
ImmutableList.Builder<StaticLangPagedResponseView> pagedResponseWrappersList = ImmutableList.builder();
for (MethodModel method : context.getSupportedMethods()) {
if (context.getMethodConfig(method).isPageStreaming()) {
pagedResponseWrappersList.add(generatePagedResponseWrapper(context.asRequestMethodContext(method), context.getImportTypeTable()));
}
}
return pagedResponseWrappersList.build();
}
Aggregations