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 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"); } }