from intervalsicu.api.intervals_object import IntervalsObject


class Activity(dict):
    fields = [
        'analyzed',
        'athlete_max_hr',
        'average_cadence',
        'average_heartrate',
        'average_speed',
        'average_temp',
        'avg_lr_balance',
        'calories',
        'coasting_time',
        'commute',
        'decoupling',
        'description',
        'device_name',
        'device_watts',
        'distance',
        'elapsed_time',
        'external_id',
        'file_type',
        'gap',
        'gap_model',
        'gap_zone_times',
        'gear',
        'has_heartrate',
        'hr_load',
        'hr_load_type',
        'icu_achievements',
        'icu_athlete_id',
        'icu_atl',
        'icu_average_watts',
        'icu_cadence_z2',
        'icu_chat_id',
        'icu_color',
        'icu_cooldown_time',
        'icu_ctl',
        'icu_distance',
        'icu_efficiency_factor',
        'icu_ftp',
        'icu_hr_zone_times',
        'icu_hr_zones',
        'icu_hrr',
        'icu_ignore_hr',
        'icu_ignore_power',
        'icu_ignore_time',
        'icu_intensity',
        'icu_intervals_edited',
        'icu_joules',
        'icu_joules_above_ftp',
        'icu_lap_count',
        'icu_max_wbal_depletion',
        'icu_median_time_delta',
        'icu_pm_cp',
        'icu_pm_ftp',
        'icu_pm_p_max',
        'icu_pm_w_prime',
        'icu_power_hr',
        'icu_power_hr_z2',
        'icu_power_hr_z2_mins',
        'icu_power_spike_threshold',
        'icu_power_zones',
        'icu_recording_time',
        'icu_resting_hr',
        'icu_rolling_cp',
        'icu_rolling_ftp',
        'icu_rolling_ftp_delta',
        'icu_rolling_p_max',
        'icu_rolling_w_prime',
        'icu_rpe',
        'icu_sweet_spot_max',
        'icu_sweet_spot_min',
        'icu_sync_date',
        'icu_sync_error',
        'icu_training_load',
        'icu_training_load_data',
        'icu_variability_index',
        'icu_w_prime',
        'icu_warmup_time',
        'icu_weight',
        'icu_weighted_avg_watts',
        'icu_zone_times',
        'id',
        'interval_summary',
        'lthr',
        'max_heartrate',
        'max_speed',
        'max_temp',
        'min_temp',
        'moving_time',
        'name',
        'oauth_client_id',
        'oauth_client_name',
        'p30s_exponent',
        'pace',
        'pace_load',
        'pace_load_type',
        'pace_zone_times',
        'pace_zones',
        'paired_event_id',
        'perceived_exertion',
        'power_load',
        'power_meter',
        'power_meter_battery',
        'power_meter_serial',
        'race',
        'source',
        'start_date',
        'start_date_local',
        'strava_id',
        'stream_types',
        'threshold_pace',
        'timezone',
        'tiz_order',
        'total_elevation_gain',
        'trainer',
        'type',
        'use_elevation_correction',
        'use_gap_zone_times',
        'workout_shift_secs'
    ]

    def __init__(self, **kwargs):
        IntervalsObject.validate(set(Activity.fields), set(kwargs.keys()))

        dict.__init__(self, **kwargs)
