protected void finish(UberTripEstimatesJSON result) { if (fieldGeneratorPriceEstimateRange.have_value) { result.setPriceEstimateRange(fieldGeneratorPriceEstimateRange.value); fieldGeneratorPriceEstimateRange.have_value = false; } else if ((!(result.hasPriceEstimateRange())) && !allow_incomplete) { error("When parsing the object for %what%, the \"PriceEstimateRange\" field was missing."); } if (fieldGeneratorLowPriceEstimate.have_value) { result.setLowPriceEstimateText(fieldGeneratorLowPriceEstimate.value); fieldGeneratorLowPriceEstimate.have_value = false; } if (fieldGeneratorHighPriceEstimate.have_value) { result.setHighPriceEstimateText(fieldGeneratorHighPriceEstimate.value); fieldGeneratorHighPriceEstimate.have_value = false; } if (fieldGeneratorCurrency.have_value) { result.setCurrency(fieldGeneratorCurrency.value); fieldGeneratorCurrency.have_value = false; } if (fieldGeneratorSurgeMultiplier.have_value) { result.setSurgeMultiplierText(fieldGeneratorSurgeMultiplier.value); fieldGeneratorSurgeMultiplier.have_value = false; } else if ((!(result.hasSurgeMultiplier())) && !allow_incomplete) { error("When parsing the object for %what%, the \"SurgeMultiplier\" field was missing."); } if (fieldGeneratorDurationEstimateInSeconds.have_value) { result.setDurationEstimateInSecondsText(fieldGeneratorDurationEstimateInSeconds.value); fieldGeneratorDurationEstimateInSeconds.have_value = false; } else if ((!(result.hasDurationEstimateInSeconds())) && !allow_incomplete) { error("When parsing the object for %what%, the \"DurationEstimateInSeconds\" field was missing."); } if (fieldGeneratorDistanceEstimateInMiles.have_value) { result.setDistanceEstimateInMilesText(fieldGeneratorDistanceEstimateInMiles.value); fieldGeneratorDistanceEstimateInMiles.have_value = false; } else if ((!(result.hasDistanceEstimateInMiles())) && !allow_incomplete) { error("When parsing the object for %what%, the \"DistanceEstimateInMiles\" field was missing."); } }