@Override public List<MethodModel> getPageStreamingMethods() { List<MethodModel> methods = new ArrayList<>(); for (MethodModel method : getSupportedMethods()) { if (getMethodConfig(method).isPageStreaming()) { methods.add(method); } } return methods; }
if (isProtobufEmpty(method.getOutputMessage())) { callbackType = "function(?Error)"; } else if (methodConfig.isPageStreaming()) { callbackType = String.format("function(?Error, ?Array, ?Object, ?%s)", classInfo); } else { if (!isProtobufEmpty(method.getOutputMessage())) { callbackLines.add("", " The second parameter to the callback is " + returnTypeDoc + "."); if (methodConfig.isPageStreaming()) { callbackLines.add( "",
private OptionalArrayMethodView generateOneApiMethod( GapicMethodContext methodContext, InitCodeContext initContext) { OptionalArrayMethodView methodView = null; if (methodContext.getMethodConfig().isPageStreaming()) { methodView = clientMethodTransformer.generatePagedStreamingMethod(
boolean packageHasMultipleServices) { OptionalArrayMethodView methodView; if (methodContext.getMethodConfig().isPageStreaming()) { methodView = clientMethodTransformer.generatePagedStreamingMethod(
final InitCodeContext initContext = null; if (methodContext.getMethodConfig().isPageStreaming()) { methodView = clientMethodTransformer.generatePagedStreamingMethod(
"@returns {Promise} - The promise which resolves to an array.", " The first element of the array is " + returnTypeDoc + "."); if (methodConfig.isPageStreaming()) { returnMessageLines.add( "",
private List<TestCaseView> createTestCaseViews(GapicInterfaceContext context) { ArrayList<TestCaseView> testCaseViews = new ArrayList<>(); SymbolTable testNameTable = new SymbolTable(); for (MethodModel method : context.getSupportedMethods()) { GapicMethodContext methodContext = context.asRequestMethodContext(method); ClientMethodType clientMethodType = ClientMethodType.RequestObjectMethod; if (methodContext.getMethodConfig().isPageStreaming()) { clientMethodType = ClientMethodType.PagedRequestObjectMethod; } else if (methodContext.getMethodConfig().isLongRunningOperation()) { clientMethodType = ClientMethodType.OperationRequestObjectMethod; } InitCodeContext initCodeContext = initCodeTransformer.createRequestInitCodeContext( methodContext, new SymbolTable(), methodContext.getMethodConfig().getRequiredFieldConfigs(), InitCodeOutputType.SingleObject, valueGenerator); testCaseViews.add( testCaseTransformer.createTestCaseView( methodContext, testNameTable, initCodeContext, clientMethodType)); } return testCaseViews; }
public OptionalArrayMethodView generateMethod( GapicMethodContext context, boolean packageHasMultipleServices) { MethodModel method = context.getMethodModel(); OptionalArrayMethodView.Builder apiMethod = OptionalArrayMethodView.newBuilder(); if (context.getMethodConfig().isPageStreaming()) { apiMethod.type(ClientMethodType.PagedOptionalArrayMethod); apiMethod.pageStreamingView( pageStreamingTransformer.generateDescriptor( context.getSurfaceInterfaceContext(), method)); } else if (context.getMethodConfig().isLongRunningOperation()) { apiMethod.longRunningView(lroTransformer.generateDetailView(context)); apiMethod.type(ClientMethodType.LongRunningOptionalArrayMethod); } else { apiMethod.type(ClientMethodType.OptionalArrayMethod); } generateMethodCommon( context, null, packageHasMultipleServices, method, apiMethod, Arrays.asList(CallingForm.Generic)); return apiMethod.build(); }
if (methodContext.getMethodConfig().isLongRunningOperation()) { clientMethodType = ClientMethodType.LongRunningOptionalArrayMethod; } else if (methodContext.getMethodConfig().isPageStreaming()) { clientMethodType = ClientMethodType.PagedOptionalArrayMethod;
private String returnTypeDoc(ImportTypeTable typeTable, GapicMethodConfig methodConfig) { String returnTypeDoc = ""; if (methodConfig.isPageStreaming()) { returnTypeDoc = "Array of "; FieldModel resourcesType = methodConfig.getPageStreaming().getResourcesField(); if (resourcesType.isMessage()) { returnTypeDoc += commentReformatter.getLinkedElementName( ((ProtoTypeRef) resourcesType.getType()).getProtoType().getMessageType()); } else if (resourcesType.isEnum()) { returnTypeDoc += commentReformatter.getLinkedElementName( ((ProtoTypeRef) resourcesType.getType()).getProtoType().getEnumType()); } else { // Converting to lowercase because "String" is capitalized in NodeJSModelTypeNameConverter. returnTypeDoc += getParamTypeNoCardinality(typeTable, resourcesType.getType()).toLowerCase(); } } else if (methodConfig.isLongRunningOperation()) { returnTypeDoc = "a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object"; } else { returnTypeDoc = getTypeNameDoc(typeTable, ProtoTypeRef.create(methodConfig.getMethod().getOutputType())); } return returnTypeDoc; }
if (methodContext.getMethodConfig().isLongRunningOperation()) { clientMethodType = ClientMethodType.LongRunningOptionalArrayMethod; } else if (methodContext.getMethodConfig().isPageStreaming()) { clientMethodType = ClientMethodType.PagedOptionalArrayMethod;