Search in sources :

Example 1 with BatchingConfigView

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();
}
Also used : BatchingConfigView(com.google.api.codegen.viewmodel.BatchingConfigView) BatchingConfig(com.google.api.codegen.config.BatchingConfig)

Aggregations

BatchingConfig (com.google.api.codegen.config.BatchingConfig)1 BatchingConfigView (com.google.api.codegen.viewmodel.BatchingConfigView)1