Class TakeoutRecords
Contains Google Takeout location-history records and provides filtering and nearest-record lookup.
public class TakeoutRecords
- Inheritance
-
TakeoutRecords
- Inherited Members
Fields
FormFactorDesktop
The Takeout form-factor value for desktop devices.
public const string FormFactorDesktop = "DESKTOP"
Field Value
FormFactorPhone
The Takeout form-factor value for phones.
public const string FormFactorPhone = "PHONE"
Field Value
FormFactorTablet
The Takeout form-factor value for tablets.
public const string FormFactorTablet = "TABLET"
Field Value
FormFactorUnknown
The value used when Takeout does not specify a form factor.
public const string FormFactorUnknown = ""
Field Value
Properties
Locations
Gets all deserialized location records in their source order.
public IReadOnlyList<TakeoutLocation> Locations { get; }
Property Value
Methods
FindNearestLocation(DateTime, string)
Finds the filtered location whose timestamp is closest to the requested timestamp.
public TakeoutLocation FindNearestLocation(DateTime timestamp, string formFactor)
Parameters
Returns
- TakeoutLocation
The nearest matching location.
Exceptions
- ArgumentException
No records match
formFactor.
FindNearestLocation(TakeoutLocation[], DateTime)
Finds the record whose timestamp is closest to the requested timestamp.
public static TakeoutLocation FindNearestLocation(TakeoutLocation[] locations, DateTime timestamp)
Parameters
locationsTakeoutLocation[]Locations sorted in ascending timestamp order.
timestampDateTimeThe timestamp to locate.
Returns
- TakeoutLocation
The nearest location. Equidistant records resolve to the earlier record.
Exceptions
- ArgumentException
locationsis empty.
GetFilteredLocations(string)
Gets records for a form factor, including records for which Takeout did not specify a form factor.
public TakeoutLocation[] GetFilteredLocations(string formFactor)
Parameters
formFactorstringThe Takeout form factor to include.
Returns
- TakeoutLocation[]
The matching records sorted in ascending timestamp order.