@@ -48,19 +48,47 @@ def update_from_dict(self, data: Dict[str, Any]) -> None:
4848 self .souvenir_count = try_get_from_dict (data , "souvenirCount" , self .souvenir_count )
4949 self .awarded_favorite_points = try_get_from_dict (data , "awardedFavoritePoints" , self .awarded_favorite_points )
5050
51+ @dataclass
52+ class GeocachingCoordinate :
53+ """Class to hold a Geocaching coordinate"""
54+ latitude : Optional [str ] = None
55+ longitude : Optional [str ] = None
56+
57+ def __init__ (self , * , data : Dict [str , Any ]) -> GeocachingCoordinate :
58+ """Constructor for Geocaching coordinates"""
59+ self .latitude = try_get_from_dict (data , "latitude" , None )
60+ self .longitude = try_get_from_dict (data , "longitude" , None )
61+
62+ @dataclass
63+ class GeocachingTrackableJourney :
64+ """Class to hold Geocaching trackable journey information"""
65+ coordinates : GeocachingCoordinate = None
66+ logged_date : Optional [datetime ] = None
67+
68+ def __init__ (self , * , data : Dict [str , Any ]) -> GeocachingTrackableJourney :
69+ """Constructor for Geocaching trackable journey"""
70+ if "coordinates" in data :
71+ self .coordinates = GeocachingCoordinate (data = data ["coordinates" ])
72+ else :
73+ self .coordinates = None
74+ self .logged_date = try_get_from_dict (data , "loggedDate" , self .logged_date )
75+
5176@dataclass
5277class GeocachingTrackable :
5378 """Class to hold the Geocaching trackable information"""
5479 reference_code : Optional [str ] = None
5580 name : Optional [str ] = None
5681 holder : GeocachingUser = None
5782 tracking_number : Optional [str ] = None
58- kilometers_traveled : Optional [datetime ] = None
83+ kilometers_traveled : Optional [str ] = None
84+ miles_traveled : Optional [str ] = None
5985 current_geocache_code : Optional [str ] = None
6086 current_geocache_name : Optional [str ] = None
61-
87+ latest_journey : GeocachingTrackableJourney = None
88+ is_missing : bool = False
89+
6290 def update_from_dict (self , data : Dict [str , Any ]) -> None :
63- """Update trackble from the API"""
91+ """Update trackable from the API"""
6492 self .reference_code = try_get_from_dict (data , "referenceCode" , self .reference_code )
6593 self .name = try_get_from_dict (data , "name" , self .name )
6694 if data ["holder" ] is not None :
@@ -72,8 +100,10 @@ def update_from_dict(self, data: Dict[str, Any]) -> None:
72100
73101 self .tracking_number = try_get_from_dict (data , "trackingNumber" , self .tracking_number )
74102 self .kilometers_traveled = try_get_from_dict (data , "kilometersTraveled" , self .kilometers_traveled )
103+ self .miles_traveled = try_get_from_dict (data , "milesTraveled" , self .miles_traveled )
75104 self .current_geocache_code = try_get_from_dict (data , "currectGeocacheCode" , self .current_geocache_code )
76105 self .current_geocache_name = try_get_from_dict (data , "currentGeocacheName" , self .current_geocache_name )
106+ self .is_missing = try_get_from_dict (data , "isMissing" , self .is_missing )
77107
78108class GeocachingStatus :
79109 """Class to hold all account status information"""
0 commit comments