: methodConfig.getRerouteToGrpcInterface(); HttpRule httpRule = getHttpRule(method.getOptionFields()) .toBuilder() .setSelector(String.format("%s.%s", interfaceName, method.getSimpleName()))
@VisitsBefore void visit(Method method) { // Resolve input and output type of this method. TypeRef inputType = resolveType(method.getLocation(), FieldDescriptorProto.Type.TYPE_MESSAGE, method.getDescriptor().getInputTypeName()); if (inputType != null) { method.setInputType(inputType); } TypeRef outputType = resolveType(method.getLocation(), FieldDescriptorProto.Type.TYPE_MESSAGE, method.getDescriptor().getOutputTypeName()); if (outputType != null) { method.setOutputType(outputType); } findOptionTypes(method.getOptionFields()); }
@VisitsBefore void visit(Method method) { // Resolve input and output type of this method. TypeRef inputType = resolveType(method.getLocation(), FieldDescriptorProto.Type.TYPE_MESSAGE, method.getDescriptor().getInputTypeName()); if (inputType != null) { method.setInputType(inputType); } TypeRef outputType = resolveType(method.getLocation(), FieldDescriptorProto.Type.TYPE_MESSAGE, method.getDescriptor().getOutputTypeName()); if (outputType != null) { method.setOutputType(outputType); } findOptionTypes(method.getOptionFields()); }
@VisitsBefore void normalize(Interface iface) { Api.Builder coreApiBuilder = Api.newBuilder().setName(iface.getFullName()); coreApiBuilder.setSourceContext( SourceContext.newBuilder().setFileName(iface.getFile().getLocation().getDisplayString())); coreApiBuilder.setSyntax(iface.getSyntax()); for (Method method : iface.getReachableMethods()) { com.google.protobuf.Method.Builder coreMethodBuilder = com.google.protobuf.Method.newBuilder() .setName(method.getSimpleName()) .setRequestTypeUrl(generateTypeUrl(method.getInputType())) .setResponseTypeUrl(generateTypeUrl(method.getOutputType())); coreMethodBuilder.setRequestStreaming(method.getRequestStreaming()); coreMethodBuilder.setResponseStreaming(method.getResponseStreaming()); coreMethodBuilder.addAllOptions( DescriptorNormalization.getMethodOptions( method.getOptionFields(), false, includeDefaults)); coreApiBuilder.addMethods(coreMethodBuilder); } coreApiBuilder.addAllOptions( DescriptorNormalization.getOptions(iface.getProto(), includeDefaults)); coreApiBuilder.setVersion(iface.getAttribute(VersionAttribute.KEY).majorVersion()); apis.add(coreApiBuilder.build()); }
@VisitsBefore void normalize(Interface iface) { Api.Builder coreApiBuilder = Api.newBuilder().setName(iface.getFullName()); coreApiBuilder.setSourceContext( SourceContext.newBuilder().setFileName(iface.getFile().getLocation().getDisplayString())); coreApiBuilder.setSyntax(iface.getSyntax()); for (Method method : iface.getReachableMethods()) { com.google.protobuf.Method.Builder coreMethodBuilder = com.google.protobuf.Method.newBuilder() .setName(method.getSimpleName()) .setRequestTypeUrl(generateTypeUrl(method.getInputType())) .setResponseTypeUrl(generateTypeUrl(method.getOutputType())); coreMethodBuilder.setRequestStreaming(method.getRequestStreaming()); coreMethodBuilder.setResponseStreaming(method.getResponseStreaming()); coreMethodBuilder.addAllOptions( DescriptorNormalization.getMethodOptions( method.getOptionFields(), false, includeDefaults)); coreApiBuilder.addMethods(coreMethodBuilder); } coreApiBuilder.addAllOptions( DescriptorNormalization.getOptions(iface.getProto(), includeDefaults)); coreApiBuilder.setVersion(iface.getAttribute(VersionAttribute.KEY).majorVersion()); apis.add(coreApiBuilder.build()); }