use of com.google.api.codegen.viewmodel.StaticLangApiMethodView in project toolkit by googleapis.
the class JavaSurfaceTransformer method generateStubInterface.
private StaticLangStubInterfaceView generateStubInterface(InterfaceContext context, GapicProductConfig productConfig) {
InterfaceConfig interfaceConfig = context.getInterfaceConfig();
addStubInterfaceImports(context);
// Stub class has different default package name from methods classes.
InterfaceContext apiMethodsContext = context.withNewTypeTable(context.getNamer().getRootPackageName());
List<StaticLangApiMethodView> methods = javaApiMethodTransformer.generateApiMethods(apiMethodsContext);
for (TypeAlias alias : apiMethodsContext.getImportTypeTable().getTypeTable().getAllImports().values()) {
context.getImportTypeTable().getAndSaveNicknameFor(alias);
}
StaticLangStubInterfaceView.Builder stubInterface = StaticLangStubInterfaceView.newBuilder();
stubInterface.doc(serviceTransformer.generateServiceDoc(context, null, productConfig));
String name = context.getNamer().getApiStubInterfaceName(context.getInterfaceConfig());
stubInterface.releaseLevelAnnotation(context.getNamer().getReleaseAnnotation(productConfig.getReleaseLevel()));
stubInterface.name(name);
stubInterface.callableMethods(filterIncludeCallableMethods(methods));
stubInterface.hasLongRunningOperations(interfaceConfig.hasLongRunningOperations());
return stubInterface.build();
}
Aggregations