use of com.google.api.codegen.viewmodel.BatchingConfigView in project toolkit by googleapis.
the class BatchingTransformer method generateBatchingConfig.
public BatchingConfigView generateBatchingConfig(MethodContext context) {
BatchingConfig batchingConfig = context.getMethodConfig().getBatching();
BatchingConfigView.Builder batchingConfigView = BatchingConfigView.newBuilder();
batchingConfigView.elementCountThreshold(batchingConfig.getElementCountThreshold());
batchingConfigView.elementCountLimit(batchingConfig.getElementCountLimit());
batchingConfigView.requestByteThreshold(batchingConfig.getRequestByteThreshold());
batchingConfigView.requestByteLimit(batchingConfig.getRequestByteLimit());
batchingConfigView.delayThresholdMillis(batchingConfig.getDelayThresholdMillis());
batchingConfigView.flowControlElementLimit(batchingConfig.getFlowControlElementLimit());
batchingConfigView.flowControlByteLimit(batchingConfig.getFlowControlByteLimit());
batchingConfigView.flowControlLimitExceededBehavior(batchingConfig.getFlowControlLimitConfig().toString());
return batchingConfigView.build();
}
Aggregations