#!/usr/bin/env python

from datetime import datetime, timedelta

from aman.types.ArrivalRoute import ArrivalRoute

class ArrivalData:
    def __init__(self, **kargs):
        self.Star = None
        self.InitialArrivalTime = None
        self.ArrivalRoute = None
        self.Trackmiles = None

        for key, value in kargs.items():
            if 'star' == key:
                if True == isinstance(value, ArrivalRoute):
                    self.Star = value
                else:
                    raise Exception('Invalid type for star')
            elif 'ita' == key:
                if True == isinstance(value, datetime):
                    self.InitialArrivalTime = value
                else:
                    raise Exception('Invalid type for ita')
            elif 'route' == key:
                self.ArrivalRoute = value
            elif 'trackmiles' == key:
                self.Trackmiles = value
            else:
                raise Exception('Unknown key: ' + key)
