use of com.google.api.codegen.config.LongRunningConfig in project toolkit by googleapis.
the class LongRunningTransformer method generateDetailView.
LongRunningOperationDetailView generateDetailView(MethodContext context) {
MethodConfig methodConfig = context.getMethodConfig();
LongRunningConfig lroConfig = methodConfig.getLongRunningConfig();
SurfaceNamer namer = context.getNamer();
String clientReturnTypeName = namer.getAndSaveOperationResponseTypeName(context.getMethodModel(), context.getTypeTable(), methodConfig);
String operationPayloadTypeName = namer.getLongRunningOperationTypeName(context.getTypeTable(), lroConfig.getReturnType());
String metadataTypeName = namer.getLongRunningOperationTypeName(context.getTypeTable(), lroConfig.getMetadataType());
return LongRunningOperationDetailView.newBuilder().methodName(namer.getApiMethodName(context.getMethodModel(), VisibilityConfig.PUBLIC)).constructorName(namer.getTypeConstructor(clientReturnTypeName)).clientReturnTypeName(clientReturnTypeName).operationPayloadTypeName(operationPayloadTypeName).isEmptyOperation(lroConfig.getReturnType().isEmptyType()).metadataTypeName(metadataTypeName).implementsDelete(lroConfig.implementsDelete()).implementsCancel(lroConfig.implementsCancel()).initialPollDelay(lroConfig.getInitialPollDelay().toMillis()).pollDelayMultiplier(lroConfig.getPollDelayMultiplier()).maxPollDelay(lroConfig.getMaxPollDelay().toMillis()).totalPollTimeout(lroConfig.getTotalPollTimeout().toMillis()).build();
}
use of com.google.api.codegen.config.LongRunningConfig in project toolkit by googleapis.
the class NodeJSGapicSurfaceTransformer method createLongRunningDescriptors.
private List<LongRunningOperationDetailView> createLongRunningDescriptors(GapicInterfaceContext context) {
List<LongRunningOperationDetailView> result = new ArrayList<>();
for (MethodModel method : context.getLongRunningMethods()) {
GapicMethodContext methodContext = context.asDynamicMethodContext(method);
LongRunningConfig lroConfig = methodContext.getMethodConfig().getLongRunningConfig();
TypeModel returnType = lroConfig.getReturnType();
TypeModel metadataType = lroConfig.getMetadataType();
result.add(LongRunningOperationDetailView.newBuilder().methodName(context.getNamer().getApiMethodName(method, VisibilityConfig.PUBLIC)).constructorName("").clientReturnTypeName("").operationPayloadTypeName(context.getImportTypeTable().getFullNameFor(returnType)).isEmptyOperation(lroConfig.getReturnType().isEmptyType()).metadataTypeName(context.getImportTypeTable().getFullNameFor(metadataType)).implementsCancel(true).implementsDelete(true).initialPollDelay(lroConfig.getInitialPollDelay().toMillis()).pollDelayMultiplier(lroConfig.getPollDelayMultiplier()).maxPollDelay(lroConfig.getMaxPollDelay().toMillis()).totalPollTimeout(lroConfig.getTotalPollTimeout().toMillis()).build());
}
return result;
}
use of com.google.api.codegen.config.LongRunningConfig in project toolkit by googleapis.
the class PhpGapicSurfaceTransformer method createLongRunningDescriptors.
private List<LongRunningOperationDetailView> createLongRunningDescriptors(GapicInterfaceContext context) {
List<LongRunningOperationDetailView> result = new ArrayList<>();
for (MethodModel method : context.getLongRunningMethods()) {
GapicMethodContext methodContext = context.asDynamicMethodContext(method);
LongRunningConfig lroConfig = methodContext.getMethodConfig().getLongRunningConfig();
TypeModel returnType = lroConfig.getReturnType();
TypeModel metadataType = lroConfig.getMetadataType();
result.add(LongRunningOperationDetailView.newBuilder().methodName(context.getNamer().getApiMethodName(method, VisibilityConfig.PUBLIC)).transportMethodName(context.getNamer().getGrpcMethodName(method)).constructorName("").clientReturnTypeName("").operationPayloadTypeName(context.getImportTypeTable().getFullNameFor(returnType)).isEmptyOperation(lroConfig.getReturnType().isEmptyType()).metadataTypeName(context.getImportTypeTable().getFullNameFor(metadataType)).implementsCancel(true).implementsDelete(true).initialPollDelay(lroConfig.getInitialPollDelay().toMillis()).pollDelayMultiplier(lroConfig.getPollDelayMultiplier()).maxPollDelay(lroConfig.getMaxPollDelay().toMillis()).totalPollTimeout(lroConfig.getTotalPollTimeout().toMillis()).build());
}
return result;
}
Aggregations