private List<ImportFileView> generateTestExternalImports(GapicInterfaceContext context) { ImmutableList.Builder<ImportFileView> externalImports = ImmutableList.builder(); if (context.getInterfaceConfig().hasLongRunningOperations()) { externalImports.add(createImport("google.rpc", "status_pb2")); } return externalImports.build(); }
private List<ImportFileView> generateGrpctransportExternalImports(GapicInterfaceContext context) { ImmutableList.Builder<ImportFileView> externalImports = ImmutableList.builder(); externalImports.add(createImport("google.api_core.grpc_helpers")); if (context.getInterfaceConfig().hasLongRunningOperations()) { externalImports.add(createImport("google.api_core.operations_v1")); } return externalImports.build(); }
private List<ImportFileView> generateExternalImports(GapicInterfaceContext context) { ImmutableList.Builder<ImportFileView> imports = ImmutableList.builder(); imports.add(createImport("google/gax")); if (context.getInterfaceConfig().hasLongRunningOperations()) { imports.add(createImport("google/gax/operation")); imports.add(createImport("google/longrunning/operations_client")); } if (RubyUtil.isLongrunning(context.getProductConfig().getPackageName())) { imports.add(createImport("googleauth")); } return imports.build(); }
private List<String> generateValidDescriptorsNames(GapicInterfaceContext context) { ImmutableList.Builder<String> validDescriptorsNames = ImmutableList.builder(); if (context.getInterfaceConfig().hasPageStreamingMethods()) { validDescriptorsNames.add("this._descriptors.page"); } if (context.getInterfaceConfig().hasBatchingMethods()) { validDescriptorsNames.add("this._descriptors.batching"); } if (context.getInterfaceConfig().hasGrpcStreamingMethods()) { validDescriptorsNames.add("this._descriptors.stream"); } if (context.getInterfaceConfig().hasLongRunningOperations()) { validDescriptorsNames.add("this._descriptors.longrunning"); } return validDescriptorsNames.build(); }
private List<ImportFileView> generateTestAppImports(GapicInterfaceContext context) { ImmutableList.Builder<ImportFileView> imports = ImmutableList.builder(); SurfaceNamer namer = context.getNamer(); if (RubyUtil.hasMajorVersion(context.getProductConfig().getPackageName())) { imports.add(createImport(namer.getTopLevelIndexFileImportName())); } else { imports.add(createImport(namer.getVersionIndexFileImportName())); } // Import the client class directly so the client class is in scope for the static class methods // used in the in the init code such as the path methods. This is not necessary for method // samples since the client is initialized before the init code, and the initialization // requires the client class file. imports.add(createImport(namer.getServiceFileName(context.getInterfaceConfig()))); for (String filename : generateImportFilenames(context)) { imports.add(createImport(namer.getServiceFileImportName(filename))); } if (context.getInterfaceConfig().hasLongRunningOperations()) { imports.add(createImport("google/longrunning/operations_pb")); } return imports.build(); }
apiClass.hasLongRunningOperations(context.getInterfaceConfig().hasLongRunningOperations()); apiClass.reroutedGrpcClients(csharpCommonTransformer.generateReroutedGrpcView(context)); apiClass.modifyMethods(generateModifyMethods(context));
private void addApiImports(GapicInterfaceContext context) { ModelTypeTable typeTable = context.getImportTypeTable(); GapicInterfaceConfig interfaceConfig = context.getInterfaceConfig(); typeTable.saveNicknameFor("\\Google\\ApiCore\\ApiException"); typeTable.saveNicknameFor("\\Google\\ApiCore\\CredentialsWrapper"); typeTable.saveNicknameFor("\\Google\\ApiCore\\GapicClientTrait"); typeTable.saveNicknameFor("\\Google\\ApiCore\\PathTemplate"); typeTable.saveNicknameFor("\\Google\\ApiCore\\RequestParamsHeaderDescriptor"); typeTable.saveNicknameFor("\\Google\\ApiCore\\RetrySettings"); typeTable.saveNicknameFor("\\Google\\ApiCore\\Transport\\TransportInterface"); typeTable.saveNicknameFor("\\Google\\ApiCore\\ValidationException"); typeTable.saveNicknameFor("\\Google\\Auth\\FetchAuthTokenInterface"); if (interfaceConfig.hasLongRunningOperations()) { typeTable.saveNicknameFor("\\Google\\ApiCore\\LongRunning\\OperationsClient"); typeTable.saveNicknameFor("\\Google\\ApiCore\\OperationResponse"); } if (interfaceConfig.hasGrpcStreamingMethods() || interfaceConfig.hasReroutedInterfaceMethods()) { typeTable.saveNicknameFor("\\Google\\ApiCore\\Call"); } }
xapiClass.hasPageStreamingMethods(context.getInterfaceConfig().hasPageStreamingMethods()); xapiClass.hasBatchingMethods(context.getInterfaceConfig().hasBatchingMethods()); xapiClass.hasLongRunningOperations(context.getInterfaceConfig().hasLongRunningOperations());
apiImplClass.hasBatchingMethods(context.getInterfaceConfig().hasBatchingMethods()); apiImplClass.longRunningDescriptors(createLongRunningDescriptors(context)); apiImplClass.hasLongRunningOperations(context.getInterfaceConfig().hasLongRunningOperations()); apiImplClass.grpcStreamingDescriptors(createGrpcStreamingDescriptors(context));
xapiClass.hasPageStreamingMethods(context.getInterfaceConfig().hasPageStreamingMethods()); xapiClass.hasBatchingMethods(context.getInterfaceConfig().hasBatchingMethods()); xapiClass.hasLongRunningOperations(context.getInterfaceConfig().hasLongRunningOperations());
xapiClass.hasPageStreamingMethods(context.getInterfaceConfig().hasPageStreamingMethods()); xapiClass.hasBatchingMethods(context.getInterfaceConfig().hasBatchingMethods()); xapiClass.hasLongRunningOperations(context.getInterfaceConfig().hasLongRunningOperations());