public static GapicMethodContext create( GapicInterfaceContext surfaceTransformerContext, Interface apiInterface, GapicProductConfig productConfig, ModelTypeTable typeTable, SurfaceNamer namer, GapicMethodConfig methodConfig, FlatteningConfig flatteningConfig, FeatureConfig featureConfig) { return new AutoValue_GapicMethodContext( productConfig, namer, flatteningConfig, featureConfig, methodConfig, surfaceTransformerContext, typeTable, new ProtoInterfaceModel(apiInterface)); }
@Override public ProtoInterfaceModel getInterface(String interfaceName) { return new ProtoInterfaceModel(protoModel.getSymbolTable().lookupInterface(interfaceName)); }
private static SmokeTestConfig createSmokeTestConfig( DiagCollector diagCollector, Interface apiInterface, InterfaceConfigProto interfaceConfigProto) { if (interfaceConfigProto.hasSmokeTest()) { return SmokeTestConfig.createSmokeTestConfig( new ProtoInterfaceModel(apiInterface), interfaceConfigProto.getSmokeTest(), diagCollector); } else { return null; } }
@Override public ProtoInterfaceModel getTargetInterface() { return new ProtoInterfaceModel( GapicInterfaceConfig.getTargetInterface( getInterface(), getMethodConfig().getRerouteToGrpcInterface())); }
@Test public void testGetAuthScopes() { List<ProtoInterfaceModel> interfaces = Arrays.asList( new ProtoInterfaceModel(libraryService), new ProtoInterfaceModel(foodService)); List<String> scopes = apiModel.getAuthScopes(protoParser, interfaces); assertThat(scopes.size()).isEqualTo(6); assertThat(scopes.contains("https://www.googleapis.com/auth/calendar")).isTrue(); assertThat(scopes.contains("https://www.googleapis.com/auth/calendar.read")).isTrue(); assertThat(scopes.contains("https://www.googleapis.com/auth/default")).isTrue(); assertThat(scopes.contains("https://www.googleapis.com/auth/food")).isTrue(); assertThat(scopes.contains("https://www.googleapis.com/auth/library")).isTrue(); assertThat(scopes.contains("https://www.googleapis.com/auth/pumpkin")).isTrue(); } }
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)); }
return new AutoValue_GapicInterfaceConfig( interfaceNameOverride, new ProtoInterfaceModel(apiInterface), methodConfigs, smokeTestConfig,
RubyUtil.getSentence(namer.getDocLines(GapicParser.getDocString(apiInterface))); InterfaceConfig interfaceConfig = productConfig.getInterfaceConfig(new ProtoInterfaceModel(apiInterface)); tocContents.add( metadataTransformer.generateTocContent(