/** * Returns the methods reachable with the active scoper. */ public Iterable<Method> getReachableMethods() { return getModel().reachable(methods); }
/** * Returns the methods reachable with the active scoper. */ public Iterable<Method> getReachableMethods() { return getModel().reachable(methods); }
public ProtoInterfaceModel(Interface protoInterface) { this.protoInterface = protoInterface; apiModel = new ProtoApiModel(protoInterface.getModel()); }
public Model getModel() { return getInterface().getModel(); }
/** * If rerouteToGrpcInterface is set, then looks up that interface and returns it, otherwise * returns the value of defaultInterface. */ public static Interface getTargetInterface( Interface defaultInterface, String rerouteToGrpcInterface) { Interface targetInterface = defaultInterface; if (!Strings.isNullOrEmpty(rerouteToGrpcInterface)) { targetInterface = defaultInterface.getModel().getSymbolTable().lookupInterface(rerouteToGrpcInterface); if (targetInterface == null) { throw new IllegalArgumentException( "reroute_to_grpc_interface not found: " + rerouteToGrpcInterface); } } return targetInterface; }
@Override public List<MethodModel> getMethods() { ImmutableList.Builder<MethodModel> methods = ImmutableList.builder(); for (Method method : protoInterface.getMethods()) { methods.add(new ProtoMethodModel(method)); } SymbolTable symbolTable = protoInterface.getModel().getSymbolTable(); for (Mixin mixin : protoInterface.getConfig().getMixinsList()) { Interface mixinInterface = symbolTable.lookupInterface(mixin.getName()); for (Method method : mixinInterface.getMethods()) { methods.add(new ProtoMethodModel(method)); } } return methods.build(); }
public static GapicInterfaceContext create( InterfaceModel apiInterface, GapicProductConfig productConfig, ModelTypeTable typeTable, SurfaceNamer namer, FeatureConfig featureConfig) { ProtoInterfaceModel protoInterface = (ProtoInterfaceModel) apiInterface; return new AutoValue_GapicInterfaceContext( protoInterface, productConfig, typeTable, namer, featureConfig, createGrpcRerouteMap(protoInterface.getInterface().getModel(), productConfig)); }
private void addApiImports(GapicInterfaceContext context) { for (TypeRef type : context.getInterface().getModel().getSymbolTable().getDeclaredTypes()) { if (type.isEnum() && type.getEnumType().isReachable()) { context.getImportTypeTable().getAndSaveNicknameFor(type); break; } } for (MethodModel method : context.getSupportedMethods()) { addMethodImports(context.asDynamicMethodContext(method)); } }
private void addApiImports(GapicInterfaceContext context) { for (TypeRef type : context.getInterface().getModel().getSymbolTable().getDeclaredTypes()) { if (type.isEnum() && type.getEnumType().isReachable()) { context.getImportTypeTable().getAndSaveNicknameFor(type); break; } } for (MethodModel method : context.getSupportedMethods()) { addMethodImports(context.asDynamicMethodContext(method)); } }
apiImplClass.serviceHostname(productServiceConfig.getServiceHostname(serviceAddress)); apiImplClass.servicePort(productServiceConfig.getServicePort(serviceAddress)); apiImplClass.serviceTitle(productServiceConfig.getTitle(context.getInterface().getModel())); apiImplClass.authScopes(productServiceConfig.getAuthScopes(context.getInterface().getModel()));