'Get the latest product info and estimates from the Lyft API.'

def fetch_data(self):

    from lyft_rides.client import LyftRidesClient
    client = LyftRidesClient(self._session)
    self.products = {}
    products_response = client.get_ride_types(self.start_latitude, self.start_longitude)
    products = products_response.json.get('ride_types')
    for product in products:
        self.products[product['ride_type']] = product
    if ((self.end_latitude is not None) and (self.end_longitude is not None)):
        price_response = client.get_cost_estimates(self.start_latitude, self.start_longitude, self.end_latitude, self.end_longitude)
        prices = price_response.json.get('cost_estimates', [])
        for price in prices:
            product = self.products[price['ride_type']]
            if price.get('is_valid_estimate'):
                product['estimate'] = price
    eta_response = client.get_pickup_time_estimates(self.start_latitude, self.start_longitude)
    etas = eta_response.json.get('eta_estimates')
    for eta in etas:
        if eta.get('is_valid_estimate'):
            self.products[eta['ride_type']]['eta'] = eta
