def second_class_offers(self): if not from_dict(self._data, ['secondClassOffers']): return [] offer_list = [] for offer in from_dict(self._data, ['secondClassOffers', 'offers']): if offer != None: offer_list.append(TravelOffer(offer, self)) return offer_list
def fares(self): fare_list = [] for fare in from_dict(self._json, ['fares']): fare_list.append(Fare(fare)) return fare_list
def travels(self): travel_list = [] for travel in from_dict(self._json, ['travelProposals']): travel_list.append(Travel(travel)) return travel_list
def fare_code(self): return from_dict(self._data, ['metaData', 'MI', 'code'])
def mi_id(self): try: return from_dict(self._data, ['metaData', 'MI', 'miId']) except ValueError: return from_dict(self._data, ['metaData', 'MI', 'id'])
def id(self): return from_dict(self._data, ['id'])
def return_mandatory(self): return from_dict(self._data, ['returnMandatory'])
def fare_id(self): "return the fare id of the travel" return from_dict(self._data, ['passengerOfferBySegment', 0, 'idFare'])
def amount(self) -> int: return from_dict(self._data, 'amount')
def id(self) -> str: return from_dict(self._data, 'id')
def id(self) -> str: "return uuid of the travel" return from_dict(self._data, ['id'])
def departure_date(self) -> datetime.datetime: "return arrival date of the travel in datetime format" return datetime.datetime.strptime( from_dict(self._data, ['departureDate']), "%Y-%m-%dT%H:%M:%S")
def functional_id(self) -> str: "return functionalId of the travel" return from_dict(self._data, ['functionalId'])
def duration(self) -> int: "return duration in second" return from_dict(self._data, ['duration'])
def destination(self) -> Station: "Return station object of travel destination" return Station( from_dict(self._data, ['destination', 'station', 'metaData', 'MI', 'code']))
def origin(self) -> Station: "Return station object of travel origin" return Station( from_dict(self._data, ['origin', 'station', 'metaData', 'MI', 'code']))