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