/** Return a list of configs for method in the order given by the GAPIC interface config. */ static <T> List<T> createMethodConfigs( ImmutableMap<String, T> methodConfigMap, InterfaceConfigProto interfaceConfigProto) { if (interfaceConfigProto.equals(InterfaceConfigProto.getDefaultInstance())) { // InterfaceConfigProto was not given, so just return the order in methodConfigMap. return methodConfigMap.values().asList(); } List<T> methodConfigs = new ArrayList<>(); for (MethodConfigProto methodConfigProto : interfaceConfigProto.getMethodsList()) { methodConfigs.add(methodConfigMap.get(methodConfigProto.getName())); } return methodConfigs; }
/** Return the list of information about clients to be generated. */ private static ImmutableList<GapicInterfaceInput> createInterfaceInputsWithoutGapicConfig( Collection<Interface> protoInterfaces) { // Store info about each Interface in a GapicInterfaceInput object. ImmutableList.Builder<GapicInterfaceInput> interfaceInputs = ImmutableList.builder(); for (Interface apiInterface : protoInterfaces) { GapicInterfaceInput.Builder interfaceInput = GapicInterfaceInput.newBuilder() .setInterface(apiInterface) .setInterfaceConfigProto(InterfaceConfigProto.getDefaultInstance()) .setMethodsToGenerate(findMethodsToGenerateWithoutConfigYaml(apiInterface)); interfaceInputs.add(interfaceInput.build()); } return interfaceInputs.build(); }
serviceFullName, InterfaceConfigProto.getDefaultInstance()); interfaceInput.setInterfaceConfigProto(interfaceConfigProto);