diff --git a/easypost/util.py b/easypost/util.py index b46555c..d3ee927 100644 --- a/easypost/util.py +++ b/easypost/util.py @@ -7,6 +7,7 @@ Dict, List, Optional, + Union, ) from easypost.constant import ( @@ -24,10 +25,11 @@ InvalidParameterError, SignatureVerificationError, ) +from easypost.models.rate import Rate def get_lowest_object_rate( - easypost_object: EasyPostObject, + easypost_object: Union[EasyPostObject, Dict[str, Any]], carriers: Optional[List[str]] = None, services: Optional[List[str]] = None, rates_key: str = "rates", @@ -53,7 +55,7 @@ def get_lowest_object_rate( return lowest_rate -def get_lowest_smart_rate(smart_rates, delivery_days: int, delivery_accuracy: str): +def get_lowest_smart_rate(smart_rates: List[Rate], delivery_days: int, delivery_accuracy: str): """Get the lowest SmartRate from a list of SmartRates.""" valid_delivery_accuracy_values = { "percentile_50",