<s> from . model_base import ModelField , Model , DictField , Field , BooleanField , NumberField , ListField , FloatField , DateTimeField , StringField , EpochField <EOL> class GPSLocation ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , latitude , longitude , altitude = None , vertical_accuracy = None , horizontal_accuracy = None ) : <EOL> self . latitude = latitude <EOL> self . longitude = longitude <EOL> self . altitude = altitude <EOL> self . vertical_accuracy = vertical_accuracy <EOL> self . horizontal_accuracy = horizontal_accuracy <EOL> class UberVehicleType ( object ) : <EOL> """<STR_LIT>""" <EOL> BLACK_CAR = <NUM_LIT:1> <EOL> UBERX = <NUM_LIT:8> <EOL> SUV = <NUM_LIT:2> <EOL> TAXI = <NUM_LIT> <EOL> class ClientStatus ( object ) : <EOL> LOOKING = '<STR_LIT>' <EOL> DISPATCHING = '<STR_LIT>' <EOL> WAITING_FOR_PICKUP = '<STR_LIT>' <EOL> class RequestNote ( object ) : <EOL> REQUEST_EXPIRED = '<STR_LIT>' <EOL> class DriverStatus ( object ) : <EOL> ACCEPTED = '<STR_LIT>' <EOL> class SystemMessage ( Model ) : <EOL> """<STR_LIT>""" <EOL> id = Field ( '<STR_LIT:id>' ) <EOL> etag = Field ( '<STR_LIT>' ) <EOL> display_properties = Field ( '<STR_LIT>' ) <EOL> modules = Field ( '<STR_LIT>' ) <EOL> class SimpleLocation ( Model ) : <EOL> latitude = FloatField ( '<STR_LIT>' ) <EOL> longitude = FloatField ( '<STR_LIT>' ) <EOL> class VehicleLocation ( SimpleLocation ) : <EOL> """<STR_LIT>""" <EOL> epoch = EpochField ( '<STR_LIT>' ) <EOL> course = Field ( '<STR_LIT>' , optional = True ) <EOL> class Fare ( Model ) : <EOL> id = NumberField ( '<STR_LIT:id>' ) <EOL> speed_threshold_mps = NumberField ( '<STR_LIT>' ) <EOL> base = StringField ( '<STR_LIT>' ) <EOL> per_minute = StringField ( '<STR_LIT>' ) <EOL> per_distance_unit = StringField ( '<STR_LIT>' ) <EOL> distance_unit = StringField ( '<STR_LIT>' ) <EOL> type = StringField ( '<STR_LIT:type>' ) <EOL> minimum = StringField ( '<STR_LIT>' ) <EOL> cancellation = StringField ( '<STR_LIT>' ) <EOL> class Place ( Model ) : <EOL> """<STR_LIT>""" <EOL> id = NumberField ( '<STR_LIT:id>' ) <EOL> type = StringField ( '<STR_LIT:type>' ) <EOL> nickname = StringField ( '<STR_LIT>' ) <EOL> formatted_address = StringField ( '<STR_LIT>' ) <EOL> distance = FloatField ( '<STR_LIT>' ) <EOL> latitude = FloatField ( '<STR_LIT>' ) <EOL> longitude = FloatField ( '<STR_LIT>' ) <EOL> address_components = Field ( '<STR_LIT>' ) <EOL> class Image ( Model ) : <EOL> url = StringField ( '<STR_LIT:url>' ) <EOL> width = NumberField ( '<STR_LIT:width>' ) <EOL> height = NumberField ( '<STR_LIT>' ) <EOL> class WebView ( Model ) : <EOL> id = Field ( '<STR_LIT:id>' ) <EOL> html = StringField ( '<STR_LIT:html>' ) <EOL> class Surge ( Model ) : <EOL> """<STR_LIT>""" <EOL> fare_id = NumberField ( '<STR_LIT>' ) <EOL> multiplier = FloatField ( '<STR_LIT>' ) <EOL> expiration_time = NumberField ( '<STR_LIT>' ) <EOL> base_fee = StringField ( '<STR_LIT>' ) <EOL> per_distance_unit = StringField ( '<STR_LIT>' ) <EOL> distance_unit = StringField ( '<STR_LIT>' ) <EOL> per_minute = StringField ( '<STR_LIT>' ) <EOL> speed_threshold_mps = NumberField ( '<STR_LIT>' ) <EOL> minimum_fee = StringField ( '<STR_LIT>' ) <EOL> cancellation_fee = StringField ( '<STR_LIT>' ) <EOL> web_view = ModelField ( '<STR_LIT>' , WebView ) <EOL> class VehicleView ( Model ) : <EOL> id = NumberField ( '<STR_LIT:id>' ) <EOL> fare = ModelField ( '<STR_LIT>' , Fare ) <EOL> map_images = ListField ( '<STR_LIT>' , Image ) <EOL> mono_images = ListField ( '<STR_LIT>' , Image ) <EOL> description = StringField ( '<STR_LIT:description>' ) <EOL> pickup_eta_string = StringField ( '<STR_LIT>' ) <EOL> allow_fare_estimate = BooleanField ( '<STR_LIT>' ) <EOL> max_fare_splits = NumberField ( '<STR_LIT>' ) <EOL> capacity = NumberField ( '<STR_LIT>' ) <EOL> fare_details_url = StringField ( '<STR_LIT>' , optional = True ) <EOL> surge = ModelField ( '<STR_LIT>' , Surge , optional = True ) <EOL> confirm_pickup_button_string = StringField ( '<STR_LIT>' ) <EOL> set_pickup_location_string = StringField ( '<STR_LIT>' ) <EOL> request_pickup_button_string = StringField ( '<STR_LIT>' ) <EOL> pickup_button_string = StringField ( '<STR_LIT>' ) <EOL> none_available_string = StringField ( '<STR_LIT>' ) <EOL> class City ( Model ) : <EOL> name = StringField ( '<STR_LIT>' ) <EOL> currency_code = StringField ( '<STR_LIT>' ) <EOL> vehicle_views = DictField ( '<STR_LIT>' , VehicleView , key = int ) <EOL> vehicle_views_order = Field ( '<STR_LIT>' ) <EOL> default_vehicle_view_id = NumberField ( '<STR_LIT>' ) <EOL> class NearbyVehicles ( Model ) : <EOL> eta_string = StringField ( '<STR_LIT>' , optional = True ) <EOL> eta_string_short = StringField ( '<STR_LIT>' , optional = True ) <EOL> min_eta = NumberField ( '<STR_LIT>' , optional = True ) <EOL> sorry_message = StringField ( '<STR_LIT>' , optional = True ) <EOL> vehicle_paths = DictField ( '<STR_LIT>' , lambda x : [ VehicleLocation ( location ) for location in x ] , optional = True ) <EOL> @ property <EOL> def is_available ( self ) : <EOL> return self . sorry_message is None <EOL> class PaymentProfile ( Model ) : <EOL> id = NumberField ( '<STR_LIT:id>' ) <EOL> billing_country_iso2 = StringField ( '<STR_LIT>' , optional = True ) <EOL> card_type = StringField ( '<STR_LIT>' ) <EOL> card_number = StringField ( '<STR_LIT>' ) <EOL> account_name = StringField ( '<STR_LIT>' , optional = True ) <EOL> token_type = StringField ( '<STR_LIT>' , optional = True ) <EOL> card_expiration = DateTimeField ( '<STR_LIT>' ) <EOL> use_case = StringField ( '<STR_LIT>' ) <EOL> class Experiment ( Model ) : <EOL> treatment_group_serial = Field ( '<STR_LIT>' , optional = True ) <EOL> treatment_group_name = Field ( '<STR_LIT>' ) <EOL> def __init__ ( self , name , data ) : <EOL> super ( Experiment , self ) . __init__ ( data ) <EOL> self . _name = name <EOL> @ property <EOL> def name ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _name <EOL> class CreditBalance ( Model ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class Driver ( Model ) : <EOL> """<STR_LIT>""" <EOL> id = Field ( '<STR_LIT:id>' ) <EOL> display_company = BooleanField ( '<STR_LIT>' ) <EOL> partner_company = StringField ( '<STR_LIT>' ) <EOL> location = ModelField ( '<STR_LIT:location>' , SimpleLocation ) <EOL> rating = FloatField ( '<STR_LIT>' ) <EOL> status = Field ( '<STR_LIT:status>' ) <EOL> phone = StringField ( '<STR_LIT>' ) <EOL> name = StringField ( '<STR_LIT:name>' ) <EOL> picture_url = StringField ( '<STR_LIT>' ) <EOL> class FeedbackType ( Model ) : <EOL> id = Field ( '<STR_LIT:id>' ) <EOL> type = Field ( '<STR_LIT:type>' ) <EOL> description = Field ( '<STR_LIT:description>' ) <EOL> class VehicleType ( Model ) : <EOL> id = NumberField ( '<STR_LIT:id>' ) <EOL> capacity = NumberField ( '<STR_LIT>' ) <EOL> make = StringField ( '<STR_LIT>' ) <EOL> model = StringField ( '<STR_LIT>' ) <EOL> class Vehicle ( Model ) : <EOL> uuid = Field ( '<STR_LIT>' ) <EOL> vehicle_type = ModelField ( '<STR_LIT>' , VehicleType ) <EOL> exterior_color = StringField ( '<STR_LIT>' ) <EOL> interior_color = StringField ( '<STR_LIT>' ) <EOL> license_plate = StringField ( '<STR_LIT>' ) <EOL> license_plate_country_id = Field ( '<STR_LIT>' ) <EOL> license_plate_state = StringField ( '<STR_LIT>' ) <EOL> vehicle_view_id = Field ( '<STR_LIT>' ) <EOL> year = NumberField ( '<STR_LIT>' ) <EOL> vehicle_path = ListField ( '<STR_LIT>' , VehicleLocation ) <EOL> class TripState ( object ) : <EOL> DISPATCHING = <NUM_LIT:0> <EOL> DRIVING_TO_PICKUP = <NUM_LIT:1> <EOL> IN_PROGRESS = <NUM_LIT:2> <EOL> class Trip ( Model ) : <EOL> """<STR_LIT>""" <EOL> driver = ModelField ( '<STR_LIT>' , Driver , optional = True ) <EOL> vehicle = ModelField ( '<STR_LIT>' , Vehicle , optional = True ) <EOL> is_zero_tolerance = BooleanField ( '<STR_LIT>' , optional = True ) <EOL> feedback_types = ListField ( '<STR_LIT>' , FeedbackType , optional = True ) <EOL> eta = NumberField ( '<STR_LIT>' , optional = True ) <EOL> eta_string = Field ( '<STR_LIT>' , optional = True ) <EOL> eta_string_short = Field ( '<STR_LIT>' , optional = True ) <EOL> dispatch_percent = FloatField ( '<STR_LIT>' , optional = True ) <EOL> payment_profile_id = NumberField ( '<STR_LIT>' ) <EOL> use_credits = BooleanField ( '<STR_LIT>' ) <EOL> pickup_location = Field ( '<STR_LIT>' ) <EOL> cancel_dialog = Field ( '<STR_LIT>' ) <EOL> @ property <EOL> def state ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . dispatch_percent is not None : <EOL> return TripState . DISPATCHING <EOL> elif self . eta is not None : <EOL> return TripState . DRIVING_TO_PICKUP <EOL> else : <EOL> return TripState . IN_PROGRESS <EOL> class Client ( Model ) : <EOL> id = NumberField ( '<STR_LIT:id>' ) <EOL> rating = FloatField ( '<STR_LIT>' ) <EOL> has_american_mobile = BooleanField ( '<STR_LIT>' ) <EOL> credit_balances = ListField ( '<STR_LIT>' , CreditBalance ) <EOL> payment_profiles = ListField ( '<STR_LIT>' , PaymentProfile ) <EOL> fare_split_fee_string = Field ( '<STR_LIT>' ) <EOL> last_selected_payment_profile_id = NumberField ( '<STR_LIT>' ) <EOL> mobile_digits = StringField ( '<STR_LIT>' ) <EOL> is_admin = BooleanField ( '<STR_LIT>' ) <EOL> role = Field ( '<STR_LIT>' ) <EOL> referral_code = StringField ( '<STR_LIT>' ) <EOL> email = StringField ( '<STR_LIT:email>' ) <EOL> picture_url = StringField ( '<STR_LIT>' ) <EOL> referral_url = StringField ( '<STR_LIT>' ) <EOL> first_name = StringField ( '<STR_LIT>' ) <EOL> mobile_country_iso2 = StringField ( '<STR_LIT>' ) <EOL> mobile = StringField ( '<STR_LIT>' ) <EOL> last_name = StringField ( '<STR_LIT>' ) <EOL> mobile_country_id = NumberField ( '<STR_LIT>' ) <EOL> login_token = StringField ( '<STR_LIT>' ) <EOL> has_to_opt_in_sms_notifications = BooleanField ( '<STR_LIT>' ) <EOL> mobile_country_code = StringField ( '<STR_LIT>' ) <EOL> promotion = Field ( '<STR_LIT>' ) <EOL> has_confirmed_mobile = BooleanField ( '<STR_LIT>' ) <EOL> status = StringField ( '<STR_LIT:status>' , optional = True ) <EOL> last_request_note = StringField ( '<STR_LIT>' , optional = True ) <EOL> last_request_msg = StringField ( '<STR_LIT>' , optional = True ) <EOL> @ property <EOL> def active_experiments ( self ) : <EOL> return { k : Experiment ( k , v ) for k , v in self . _data [ '<STR_LIT>' ] . items ( ) } <EOL> class ApiResponse ( Model ) : <EOL> data = Field ( '<STR_LIT:data>' , optional = True ) <EOL> error = Field ( '<STR_LIT:error>' , optional = True ) <EOL> @ property <EOL> def valid ( self ) : <EOL> return self . error is None <EOL> class AppState ( Model ) : <EOL> city = ModelField ( '<STR_LIT>' , City ) <EOL> nearby_vehicles = DictField ( '<STR_LIT>' , NearbyVehicles , key = int , optional = True ) <EOL> client = ModelField ( '<STR_LIT>' , Client ) <EOL> trip = ModelField ( '<STR_LIT>' , Trip , optional = True ) <EOL> api_response = ModelField ( '<STR_LIT>' , ApiResponse , optional = True ) </s>
