use of com.google.api.codegen.viewmodel.BatchingPartitionKeyView in project toolkit by googleapis.
the class BatchingTransformer method generatePartitionKeys.
private List<BatchingPartitionKeyView> generatePartitionKeys(MethodContext context) {
List<BatchingPartitionKeyView> keys = new ArrayList<>();
BatchingConfig batching = context.getMethodConfig().getBatching();
for (GenericFieldSelector fieldSelector : batching.getDiscriminatorFields()) {
FieldModel selectedType = fieldSelector.getLastField();
BatchingPartitionKeyView key = BatchingPartitionKeyView.newBuilder().fieldGetFunction(context.getNamer().getFieldGetFunctionName(selectedType)).build();
keys.add(key);
}
return keys;
}
Aggregations