/** ApiCalls that send exactly one request. This includes unary and server streaming apis. */ public List<ApiCallSettingsView> singleRequestRpcCallSettings() { ArrayList<ApiCallSettingsView> retryableCallSettings = new ArrayList<>(); for (ApiCallSettingsView settingsView : callSettings()) { if (settingsView.type().serviceMethodType() == ServiceMethodType.UnaryMethod || settingsView.type().serviceMethodType() == ServiceMethodType.GrpcServerStreamingMethod) { retryableCallSettings.add(settingsView); } } return retryableCallSettings; }
ApiCallableImplType callableImplType = ApiCallableImplType.SimpleApiCallable; if (methodConfig.isGrpcStreaming()) { callableImplType = ApiCallableImplType.of(methodConfig.getGrpcStreamingType()); } else if (methodConfig.isBatching()) { callableImplType = ApiCallableImplType.BatchingApiCallable; .callableName(callableName) .interfaceTypeName( context.getNamer().getApiCallableTypeName(callableImplType.serviceMethodType())) .build());
public List<ApiCallSettingsView> generateApiCallableSettings(MethodContext context) { List<ApiCallSettingsView> settings = new ArrayList<>(); MethodConfig methodConfig = context.getMethodConfig(); if (methodConfig.isGrpcStreaming()) { settings.add( generateApiCallableSettings( context, ApiCallableImplType.of(methodConfig.getGrpcStreamingType()))); } else if (methodConfig.isPageStreaming()) { settings.add(generateApiCallableSettings(context, ApiCallableImplType.PagedApiCallable)); } else if (methodConfig.isBatching()) { settings.add(generateApiCallableSettings(context, ApiCallableImplType.BatchingApiCallable)); } else if (methodConfig.isLongRunningOperation()) { if (context.getFeatureConfig().enableRawOperationCallSettings()) { settings.add(generateApiCallableSettings(context, ApiCallableImplType.SimpleApiCallable)); } settings.add(generateApiCallableSettings(context, ApiCallableImplType.OperationApiCallable)); } else { settings.add(generateApiCallableSettings(context, ApiCallableImplType.SimpleApiCallable)); } return settings; }
callableImplType = ApiCallableImplType.of(methodConfig.getGrpcStreamingType()); apiCallableBuilder.grpcStreamingType(methodConfig.getGrpcStreamingType()); } else if (methodConfig.isBatching()) { namer.getApiCallableTypeName(callableImplType.serviceMethodType()));
case ClientStreamingApiCallable: case ServerStreamingApiCallable: settings.type(ApiCallableImplType.of(methodConfig.getGrpcStreamingType())); if (methodConfig.getGrpcStreaming().hasResourceField()) { FieldModel resourceType = methodConfig.getGrpcStreaming().getResourcesField();
public List<ApiCallSettingsView> longRunningCallSettings() { ArrayList<ApiCallSettingsView> unaryCallSettings = new ArrayList<>(); for (ApiCallSettingsView settingsView : callSettings()) { if (settingsView.type().serviceMethodType() == ServiceMethodType.LongRunningMethod) { unaryCallSettings.add(settingsView); } } return unaryCallSettings; }
public List<ApiCallSettingsView> unaryCallSettings() { ArrayList<ApiCallSettingsView> unaryCallSettings = new ArrayList<>(); for (ApiCallSettingsView settingsView : callSettings()) { if (settingsView.type().serviceMethodType() == ServiceMethodType.UnaryMethod) { unaryCallSettings.add(settingsView); } } return unaryCallSettings; }
public List<ApiCallSettingsView> unaryCallSettings() { ArrayList<ApiCallSettingsView> unaryCallSettings = new ArrayList<>(); for (ApiCallSettingsView settingsView : callSettings()) { if (settingsView.type().serviceMethodType() == ServiceMethodType.UnaryMethod) { unaryCallSettings.add(settingsView); } } return unaryCallSettings; }
public List<ApiCallSettingsView> longRunningCallSettings() { ArrayList<ApiCallSettingsView> unaryCallSettings = new ArrayList<>(); for (ApiCallSettingsView settingsView : callSettings()) { if (settingsView.type().serviceMethodType() == ServiceMethodType.LongRunningMethod) { unaryCallSettings.add(settingsView); } } return unaryCallSettings; }