@Override public String getName() { return getInterfaceNameOverride() != null ? getInterfaceNameOverride() : getInterface().getSimpleName(); }
public Interface getInterface() { return getInterfaceModel().getInterface(); }
/** Returns the GapicMethodConfig for the given method. */ @Override public GapicMethodConfig getMethodConfig(MethodModel method) { return getMethodConfig(method.getSimpleName()); }
@Override public boolean hasBatchingMethods() { for (MethodConfig methodConfig : getMethodConfigs()) { if (methodConfig.isBatching()) { return true; } } return false; }
if (retryCodesConfig != null && retrySettingsDefinition != null) { methodConfigsMap = createMethodConfigMap( diagCollector, language, return null; methodConfigs = createMethodConfigs(methodConfigsMap, interfaceConfigProto); } else { methodConfigsMap = ImmutableMap.of(); createSmokeTestConfig(diagCollector, apiInterface, interfaceConfigProto);
/** * Returns a list of methods with samples, similar to getSupportedMethods, but also filter out * private methods. */ @Override public List<MethodModel> getPublicMethods() { List<MethodModel> methods = new ArrayList<>(getInterfaceConfig().getMethodConfigs().size()); for (MethodModel method : getInterfaceConfigMethods()) { VisibilityConfig visibility = getInterfaceConfig().getMethodConfig(method).getVisibility(); if (isSupported(method) && visibility == VisibilityConfig.PUBLIC) { methods.add(method); } } return methods; }
public GapicMethodConfig getMethodConfig(String methodSimpleName) { return getMethodConfigMap().get(methodSimpleName); }
@Override public String getRawName() { return getInterface().getSimpleName(); }
GapicInterfaceConfig.createInterfaceConfig( diagCollector, language,
retrySettingsDefinition.keySet()); methodConfigs = GapicInterfaceConfig.createMethodConfigs(methodConfigMap, interfaceConfigProto);
private boolean hasUnaryUnary(GapicInterfaceConfig interfaceConfig) { return interfaceConfig .getMethodConfigs() .stream() .anyMatch(method -> !method.isGrpcStreaming()); }
@Override public boolean hasGrpcStreamingMethods() { for (MethodConfig methodConfig : getMethodConfigs()) { if (methodConfig.isGrpcStreaming()) { return true; } } return false; }
/** Returns the GapicMethodConfig for the given method. */ public GapicMethodConfig getMethodConfig(Method method) { return getMethodConfig(method.getSimpleName()); }
@Override public boolean hasLongRunningOperations() { for (MethodConfig methodConfig : getMethodConfigs()) { if (methodConfig.isLongRunningOperation()) { return true; } } return false; }
private boolean isSupported(MethodModel method) { boolean supported = true; supported &= getFeatureConfig().enableGrpcStreaming() || !MethodConfig.isGrpcStreamingMethod(method); supported &= getInterfaceConfig().getMethodConfig(method).getVisibility() != VisibilityConfig.DISABLED; return supported; }
@Override public boolean hasPageStreamingMethods() { for (MethodConfig methodConfig : getMethodConfigs()) { if (methodConfig.isPageStreaming()) { return true; } } return false; }
@Override public boolean hasReroutedInterfaceMethods() { for (MethodConfig methodConfig : getMethodConfigs()) { if (!Strings.isNullOrEmpty(methodConfig.getRerouteToGrpcInterface())) { return true; } } return false; } }
private boolean hasRequestHeaderParams(GapicInterfaceContext context) { return context .getInterfaceConfig() .getMethodConfigs() .stream() .anyMatch(config -> config.getHeaderRequestParams().iterator().hasNext()); }
/** Returns a list of supported methods, configured by FeatureConfig. */ @Override public List<MethodModel> getSupportedMethods() { List<MethodModel> methods = new ArrayList<>(getInterfaceConfig().getMethodConfigs().size()); for (MethodModel methodModel : getInterfaceConfigMethods()) { if (isSupported(methodModel)) { methods.add(methodModel); } } return methods; }
/** Returns a list of methods for this interface that have method configs. Memoize the result. */ @Override public List<MethodModel> getInterfaceConfigMethods() { if (interfaceMethods != null) { return interfaceMethods; } ImmutableList.Builder<MethodModel> methodBuilder = ImmutableList.builder(); for (MethodConfig methodConfig : getInterfaceConfig().getMethodConfigs()) { methodBuilder.add(new ProtoMethodModel(((GapicMethodConfig) methodConfig).getMethod())); } interfaceMethods = methodBuilder.build(); return interfaceMethods; }