@Override public Iterable<MethodModel> getLongRunningMethods() { List<MethodModel> methods = new ArrayList<>(); for (MethodModel method : getSupportedMethods()) { if (getMethodConfig(method).isLongRunningOperation()) { methods.add(method); } } return methods; }
packageHasMultipleServices, Arrays.asList(CallingForm.RequestPagedAll, CallingForm.RequestPaged)); } else if (methodContext.getMethodConfig().isLongRunningOperation()) { methodView = clientMethodTransformer.generateLongRunningMethod(
packageHasMultipleServices, Arrays.asList(CallingForm.RequestAsyncPagedAll, CallingForm.RequestAsyncPaged)); } else if (methodContext.getMethodConfig().isLongRunningOperation()) { methodView = clientMethodTransformer.generateLongRunningMethod(
false, Arrays.asList(CallingForm.RequestPaged, CallingForm.RequestPagedAll)); } else if (methodContext.getMethodConfig().isLongRunningOperation()) { methodView = clientMethodTransformer.generateLongRunningMethod(
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(); }
private void addMethodImports(GapicMethodContext context) { ModelTypeTable typeTable = context.getTypeTable(); GapicMethodConfig methodConfig = context.getMethodConfig(); if (methodConfig.isLongRunningOperation()) { typeTable.getAndSaveNicknameFor(methodConfig.getLongRunningConfig().getReturnType()); typeTable.getAndSaveNicknameFor(methodConfig.getLongRunningConfig().getMetadataType()); } typeTable.getAndSaveNicknameFor(context.getMethod().getInputType()); addFieldsImports(typeTable, methodConfig.getRequiredFields()); addFieldsImports(typeTable, methodConfig.getOptionalFields()); }
private void addMethodImports(GapicMethodContext context) { ModelTypeTable typeTable = context.getTypeTable(); GapicMethodConfig methodConfig = context.getMethodConfig(); if (methodConfig.isLongRunningOperation()) { typeTable.getAndSaveNicknameFor(methodConfig.getLongRunningConfig().getReturnType()); typeTable.getAndSaveNicknameFor(methodConfig.getLongRunningConfig().getMetadataType()); } typeTable.getAndSaveNicknameFor(context.getMethod().getInputType()); addFieldsImports(typeTable, methodConfig.getRequiredFields()); addFieldsImports(typeTable, methodConfig.getOptionalFields()); }
GapicMethodContext methodContext = context.asRequestMethodContext(method); ClientMethodType clientMethodType = ClientMethodType.OptionalArrayMethod; if (methodContext.getMethodConfig().isLongRunningOperation()) { clientMethodType = ClientMethodType.LongRunningOptionalArrayMethod; } else if (methodContext.getMethodConfig().isPageStreaming()) {
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()) {