def passenger_accept_offer():
    logger.info('Get request to accept ride offer: ' + request.url)
    accepted_offer_id = request.args.get(offer_id)
    passenger_phone_number = request.args.get(phone_number)

    return RidesHandler.passenger_offer_accept(accepted_offer_id,
                                               passenger_phone_number)
def cancel_request():
    logger.info('Get request to cancel ride requests: ' + request.url)
    canceled_request_id = request.args.get(request_id)
    user_phone_number = request.args.get(phone_number)

    return RidesHandler.cancel_ride_request(canceled_request_id,
                                            user_phone_number)
def ride_handshake():
    logger.info('Get request to ride handshake from passenger: ' + request.url)
    accepted_request_id = request.args.get(request_id)

    return RidesHandler.passenger_handshake(accepted_request_id)
def driver_accept_request():
    logger.info('Get request to accept ride requests from driver: ' +
                request.url)
    accepted_request_id = request.args.get(request_id)

    return RidesHandler.driver_request_accept(accepted_request_id)
def show_user_ride_requests():
    logger.info('Get request to show user rides: ' + request.url)
    user_phone_number = request.args.get(phone_number)
    rides = RidesHandler.get_user_rides(user_phone_number)

    return json.dumps(rides)
def find_ride():
    logger.info('Get request to find ride: ' + request.url)
    find_ride_request = create_json_object_from_request_args(request.args)

    return json.dumps(RidesHandler.find_ride(find_ride_request))
def new_ride():
    logger.info('Get request to add new ride: ' + request.url)
    add_ride_request = create_json_object_from_request_args(request.args)

    return RidesHandler.add_ride_offer(add_ride_request)
def cancel_offer():
    logger.info('Get request to cancel ride offer: ' + request.url)
    canceled_offer_id = request.args.get(offer_id)

    return RidesHandler.cancel_ride_offer(canceled_offer_id)