Edits history of script submission #20941 for ' Post workout plans to a provider (terra)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    /**
     * Post workout plans to a provider
     * Used to post workout plans users can follow on their wearable. This can be strength workouts (sets, reps, weight lifted) or cardio workouts (warmup, intervals of different intensities, cooldown etc)
     */
    export async function main(auth: RT.Terra, user_id: string | undefined, body: Body) {
    	const url = new URL(`https://api.tryterra.co/v2/plannedWorkout`)
    	for (const [k, v] of [['user_id', user_id]]) {
    		if (v !== undefined && v !== '') {
    			url.searchParams.append(k, v)
    		}
    	}
    	const response = await fetch(url, {
    		method: 'POST',
    		headers: {
    			'dev-id': auth.devId,
    			'Content-Type': 'application/json',
    			'X-api-key': auth.apiKey
    		},
    		body: JSON.stringify(body)
    	})
    	if (!response.ok) {
    		const text = await response.text()
    		throw new Error(`${response.status} ${text}`)
    	}
    	return await response.json()
    }
    
    /* eslint-disable */
    /**
     * This file was automatically generated by json-schema-to-typescript.
     * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
     * and run json-schema-to-typescript to regenerate this file.
     */
    
    export interface Body {
    	/**
    	 * PlannedWorkout entry to post to data provider
    	 */
    	data: {
    		/**
    		 * List of exercises/steps/intervals for the workout plan
    		 */
    		steps?: (
    			| {
    					/**
    					 * List of targets for the workout
    					 */
    					targets?: (
    						| {
    								/**
    								 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    								 */
    								target_type?:
    									| 'SPEED'
    									| 'HEART_RATE'
    									| 'OPEN'
    									| 'CADENCE'
    									| 'POWER'
    									| 'GRADE'
    									| 'RESISTANCE'
    									| 'POWER_LAP'
    									| 'SWIM_STROKE'
    									| 'SPEED_LAP'
    									| 'HEART_RATE_LAP'
    									| 'PACE'
    									| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    									| 'HEART_RATE_MAX_PERCENTAGE'
    									| 'SPEED_PERCENTAGE'
    									| 'POWER_PERCENTAGE'
    									| 'REPETITION'
    									| 'TSS'
    									| 'IF'
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Ideal cadence value to be maintained for the workout step
    								 */
    								cadence?: number
    								/**
    								 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    								 */
    								target_type?:
    									| 'SPEED'
    									| 'HEART_RATE'
    									| 'OPEN'
    									| 'CADENCE'
    									| 'POWER'
    									| 'GRADE'
    									| 'RESISTANCE'
    									| 'POWER_LAP'
    									| 'SWIM_STROKE'
    									| 'SPEED_LAP'
    									| 'HEART_RATE_LAP'
    									| 'PACE'
    									| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    									| 'HEART_RATE_MAX_PERCENTAGE'
    									| 'SPEED_PERCENTAGE'
    									| 'POWER_PERCENTAGE'
    									| 'REPETITION'
    									| 'TSS'
    									| 'IF'
    								/**
    								 * Minimum cadence threshold for the workout step - i.e. the user is to stay above this value during the workout
    								 */
    								cadence_low?: number
    								/**
    								 * Maximum cadence threshold for the workout step - i.e. the user is to stay under this value during the workout step
    								 */
    								cadence_high?: number
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Maximum max heart rate percentage threshold for the workout step - i.e. the user is to stay under this value during the workout step
    								 */
    								hr_percentage_low?: number
    								/**
    								 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    								 */
    								target_type?:
    									| 'SPEED'
    									| 'HEART_RATE'
    									| 'OPEN'
    									| 'CADENCE'
    									| 'POWER'
    									| 'GRADE'
    									| 'RESISTANCE'
    									| 'POWER_LAP'
    									| 'SWIM_STROKE'
    									| 'SPEED_LAP'
    									| 'HEART_RATE_LAP'
    									| 'PACE'
    									| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    									| 'HEART_RATE_MAX_PERCENTAGE'
    									| 'SPEED_PERCENTAGE'
    									| 'POWER_PERCENTAGE'
    									| 'REPETITION'
    									| 'TSS'
    									| 'IF'
    								/**
    								 * Minimum heart rate percentage threshold for the workout step - i.e. the user is to stay above this value during the workout
    								 */
    								hr_percentage_high?: number
    								/**
    								 * Ideal percentage of user's maximum HR to be maintained workout step
    								 */
    								hr_percentage?: number
    								/**
    								 * Maximum heart rate threshold for the workout step - i.e. the user is to stay under this value during the workout step
    								 */
    								hr_bpm_high?: number
    								/**
    								 * Minimum heart rate threshold for the workout step - i.e. the user is to stay above this value during the workout
    								 */
    								hr_bpm_low?: number
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    								 */
    								target_type?:
    									| 'SPEED'
    									| 'HEART_RATE'
    									| 'OPEN'
    									| 'CADENCE'
    									| 'POWER'
    									| 'GRADE'
    									| 'RESISTANCE'
    									| 'POWER_LAP'
    									| 'SWIM_STROKE'
    									| 'SPEED_LAP'
    									| 'HEART_RATE_LAP'
    									| 'PACE'
    									| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    									| 'HEART_RATE_MAX_PERCENTAGE'
    									| 'SPEED_PERCENTAGE'
    									| 'POWER_PERCENTAGE'
    									| 'REPETITION'
    									| 'TSS'
    									| 'IF'
    								/**
    								 * Maximum percentage of Functional Threshold Power for the workout step - i.e. the user is to stay under this value during the workout step
    								 */
    								power_percentage_low?: number
    								/**
    								 * Minimum percentage of Functional Threshold Power for the workout step - i.e. the user is to stay above this value during the workout
    								 */
    								power_percentage_high?: number
    								/**
    								 * Maximum power threshold for the workout step - i.e. the user is to stay under this value during the workout step
    								 */
    								power_watt_high?: number
    								/**
    								 * Minimum power threshold for the workout step - i.e. the user is to stay above this value during the workout
    								 */
    								power_watt_low?: number
    								power_watt?: number
    								/**
    								 * Ideal percentage of user's Functional Threshold Power to be maintained workout step
    								 */
    								power_percentage?: number
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    								 */
    								target_type?:
    									| 'SPEED'
    									| 'HEART_RATE'
    									| 'OPEN'
    									| 'CADENCE'
    									| 'POWER'
    									| 'GRADE'
    									| 'RESISTANCE'
    									| 'POWER_LAP'
    									| 'SWIM_STROKE'
    									| 'SPEED_LAP'
    									| 'HEART_RATE_LAP'
    									| 'PACE'
    									| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    									| 'HEART_RATE_MAX_PERCENTAGE'
    									| 'SPEED_PERCENTAGE'
    									| 'POWER_PERCENTAGE'
    									| 'REPETITION'
    									| 'TSS'
    									| 'IF'
    								/**
    								 * Maximum speed threshold for the workout step - i.e. the user is to stay under this value during the workout step
    								 */
    								speed_percentage_high?: number
    								/**
    								 * Minimum speed threshold for the workout step - i.e. the user is to stay above this value during the workout step
    								 */
    								speed_percentage_low?: number
    								/**
    								 * Ideal percentage of user's Threshold Speed, based off their Threshold Pace, to be maintained workout step. Usually, the Threshold Pace is defined as the pace one could race at for 50 to 60 minutes
    								 */
    								speed_percentage?: number
    								/**
    								 * Ideal speed value to be maintained for the workout step
    								 */
    								speed_meters_per_second?: number
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    								 */
    								target_type?:
    									| 'SPEED'
    									| 'HEART_RATE'
    									| 'OPEN'
    									| 'CADENCE'
    									| 'POWER'
    									| 'GRADE'
    									| 'RESISTANCE'
    									| 'POWER_LAP'
    									| 'SWIM_STROKE'
    									| 'SPEED_LAP'
    									| 'HEART_RATE_LAP'
    									| 'PACE'
    									| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    									| 'HEART_RATE_MAX_PERCENTAGE'
    									| 'SPEED_PERCENTAGE'
    									| 'POWER_PERCENTAGE'
    									| 'REPETITION'
    									| 'TSS'
    									| 'IF'
    								/**
    								 * Ideal pace value to be maintained for the workout step
    								 */
    								pace_minutes_per_kilometer?: number
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    								 */
    								target_type?:
    									| 'SPEED'
    									| 'HEART_RATE'
    									| 'OPEN'
    									| 'CADENCE'
    									| 'POWER'
    									| 'GRADE'
    									| 'RESISTANCE'
    									| 'POWER_LAP'
    									| 'SWIM_STROKE'
    									| 'SPEED_LAP'
    									| 'HEART_RATE_LAP'
    									| 'PACE'
    									| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    									| 'HEART_RATE_MAX_PERCENTAGE'
    									| 'SPEED_PERCENTAGE'
    									| 'POWER_PERCENTAGE'
    									| 'REPETITION'
    									| 'TSS'
    									| 'IF'
    								/**
    								 * Planned Training Stress Score to be achieved for the workout step
    								 */
    								tss?: number
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Maximum Intensity Factor to be achieved for the workout step
    								 */
    								if_high?: number
    								/**
    								 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    								 */
    								target_type?:
    									| 'SPEED'
    									| 'HEART_RATE'
    									| 'OPEN'
    									| 'CADENCE'
    									| 'POWER'
    									| 'GRADE'
    									| 'RESISTANCE'
    									| 'POWER_LAP'
    									| 'SWIM_STROKE'
    									| 'SPEED_LAP'
    									| 'HEART_RATE_LAP'
    									| 'PACE'
    									| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    									| 'HEART_RATE_MAX_PERCENTAGE'
    									| 'SPEED_PERCENTAGE'
    									| 'POWER_PERCENTAGE'
    									| 'REPETITION'
    									| 'TSS'
    									| 'IF'
    								/**
    								 * Minimum Intensity Factor to be achieved for the workout step
    								 */
    								if_low?: number
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    								 */
    								target_type?:
    									| 'SPEED'
    									| 'HEART_RATE'
    									| 'OPEN'
    									| 'CADENCE'
    									| 'POWER'
    									| 'GRADE'
    									| 'RESISTANCE'
    									| 'POWER_LAP'
    									| 'SWIM_STROKE'
    									| 'SPEED_LAP'
    									| 'HEART_RATE_LAP'
    									| 'PACE'
    									| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    									| 'HEART_RATE_MAX_PERCENTAGE'
    									| 'SPEED_PERCENTAGE'
    									| 'POWER_PERCENTAGE'
    									| 'REPETITION'
    									| 'TSS'
    									| 'IF'
    								/**
    								 * Number of repetitions of the workout step to be performed
    								 */
    								repetitions?: number
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    								 */
    								target_type?:
    									| 'SPEED'
    									| 'HEART_RATE'
    									| 'OPEN'
    									| 'CADENCE'
    									| 'POWER'
    									| 'GRADE'
    									| 'RESISTANCE'
    									| 'POWER_LAP'
    									| 'SWIM_STROKE'
    									| 'SPEED_LAP'
    									| 'HEART_RATE_LAP'
    									| 'PACE'
    									| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    									| 'HEART_RATE_MAX_PERCENTAGE'
    									| 'SPEED_PERCENTAGE'
    									| 'POWER_PERCENTAGE'
    									| 'REPETITION'
    									| 'TSS'
    									| 'IF'
    								/**
    								 * Number of swim strokes to be performed during the workout step
    								 */
    								swim_strokes?: number
    								[k: string]: unknown
    						  }
    					)[]
    					/**
    					 * Type of workout step - either repeat or one-off
    					 */
    					type?: 'STEP' | 'REPEAT_STEP'
    					/**
    					 * Planned intensity for the workout step
    					 */
    					intensity?: 'REST' | 'WARMUP' | 'COOLDOWN' | 'RECOVERY' | 'INTERVAL' | 'ACTIVE'
    					/**
    					 * Position of the workout step in the overall workout
    					 */
    					order?: number
    					/**
    					 * Description of workout step
    					 */
    					description?: string
    					/**
    					 * List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed
    					 */
    					durations?: (
    						| {
    								/**
    								 * Type of condition that must be fulfilled to consider the workout step complete
    								 */
    								duration_type?:
    									| 'TIME'
    									| 'DISTANCE_METERS'
    									| 'HR_LESS_THAN'
    									| 'HR_GREATER_THAN'
    									| 'CALORIES'
    									| 'OPEN'
    									| 'POWER_LESS_THAN'
    									| 'POWER_GREATER_THAN'
    									| 'REPETITION_TIME'
    									| 'REPS'
    									| 'FIXED_REST'
    									| 'TIME_AT_VALID_CDA'
    									| 'STEPS'
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Time duration to be elapsed for the workout step
    								 */
    								seconds?: number
    								/**
    								 * Type of condition that must be fulfilled to consider the workout step complete
    								 */
    								duration_type?:
    									| 'TIME'
    									| 'DISTANCE_METERS'
    									| 'HR_LESS_THAN'
    									| 'HR_GREATER_THAN'
    									| 'CALORIES'
    									| 'OPEN'
    									| 'POWER_LESS_THAN'
    									| 'POWER_GREATER_THAN'
    									| 'REPETITION_TIME'
    									| 'REPS'
    									| 'FIXED_REST'
    									| 'TIME_AT_VALID_CDA'
    									| 'STEPS'
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Threshold power goal to complete the workout step - once the user reaches above this power level, the step will be completed
    								 */
    								power_above_watts?: number
    								/**
    								 * Type of condition that must be fulfilled to consider the workout step complete
    								 */
    								duration_type?:
    									| 'TIME'
    									| 'DISTANCE_METERS'
    									| 'HR_LESS_THAN'
    									| 'HR_GREATER_THAN'
    									| 'CALORIES'
    									| 'OPEN'
    									| 'POWER_LESS_THAN'
    									| 'POWER_GREATER_THAN'
    									| 'REPETITION_TIME'
    									| 'REPS'
    									| 'FIXED_REST'
    									| 'TIME_AT_VALID_CDA'
    									| 'STEPS'
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Threshold power goal to complete the workout step - once the user reaches below this power level, the step will be completed
    								 */
    								power_below_watts?: number
    								/**
    								 * Type of condition that must be fulfilled to consider the workout step complete
    								 */
    								duration_type?:
    									| 'TIME'
    									| 'DISTANCE_METERS'
    									| 'HR_LESS_THAN'
    									| 'HR_GREATER_THAN'
    									| 'CALORIES'
    									| 'OPEN'
    									| 'POWER_LESS_THAN'
    									| 'POWER_GREATER_THAN'
    									| 'REPETITION_TIME'
    									| 'REPS'
    									| 'FIXED_REST'
    									| 'TIME_AT_VALID_CDA'
    									| 'STEPS'
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Type of condition that must be fulfilled to consider the workout step complete
    								 */
    								duration_type?:
    									| 'TIME'
    									| 'DISTANCE_METERS'
    									| 'HR_LESS_THAN'
    									| 'HR_GREATER_THAN'
    									| 'CALORIES'
    									| 'OPEN'
    									| 'POWER_LESS_THAN'
    									| 'POWER_GREATER_THAN'
    									| 'REPETITION_TIME'
    									| 'REPS'
    									| 'FIXED_REST'
    									| 'TIME_AT_VALID_CDA'
    									| 'STEPS'
    								/**
    								 * Time duration to be elapsed for the rest period
    								 */
    								rest_seconds?: number
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Calorie burn target for the workout step - once the user reaches the target, the step will be completed
    								 */
    								calories?: number
    								/**
    								 * Type of condition that must be fulfilled to consider the workout step complete
    								 */
    								duration_type?:
    									| 'TIME'
    									| 'DISTANCE_METERS'
    									| 'HR_LESS_THAN'
    									| 'HR_GREATER_THAN'
    									| 'CALORIES'
    									| 'OPEN'
    									| 'POWER_LESS_THAN'
    									| 'POWER_GREATER_THAN'
    									| 'REPETITION_TIME'
    									| 'REPS'
    									| 'FIXED_REST'
    									| 'TIME_AT_VALID_CDA'
    									| 'STEPS'
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Type of condition that must be fulfilled to consider the workout step complete
    								 */
    								duration_type?:
    									| 'TIME'
    									| 'DISTANCE_METERS'
    									| 'HR_LESS_THAN'
    									| 'HR_GREATER_THAN'
    									| 'CALORIES'
    									| 'OPEN'
    									| 'POWER_LESS_THAN'
    									| 'POWER_GREATER_THAN'
    									| 'REPETITION_TIME'
    									| 'REPS'
    									| 'FIXED_REST'
    									| 'TIME_AT_VALID_CDA'
    									| 'STEPS'
    								/**
    								 * Threshold heart rate goal to complete the workout step - once the user's heart rate reaches above below this value, the step will be completed
    								 */
    								hr_above_bpm?: number
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Threshold heart rate goal to complete the workout step - once the user's heart rate reaches below this value, the step will be completed
    								 */
    								hr_below_bpm?: number
    								/**
    								 * Type of condition that must be fulfilled to consider the workout step complete
    								 */
    								duration_type?:
    									| 'TIME'
    									| 'DISTANCE_METERS'
    									| 'HR_LESS_THAN'
    									| 'HR_GREATER_THAN'
    									| 'CALORIES'
    									| 'OPEN'
    									| 'POWER_LESS_THAN'
    									| 'POWER_GREATER_THAN'
    									| 'REPETITION_TIME'
    									| 'REPS'
    									| 'FIXED_REST'
    									| 'TIME_AT_VALID_CDA'
    									| 'STEPS'
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Target number of reps for the workout step - once the user completes this rep target, the step will be completed
    								 */
    								reps?: number
    								/**
    								 * Type of condition that must be fulfilled to consider the workout step complete
    								 */
    								duration_type?:
    									| 'TIME'
    									| 'DISTANCE_METERS'
    									| 'HR_LESS_THAN'
    									| 'HR_GREATER_THAN'
    									| 'CALORIES'
    									| 'OPEN'
    									| 'POWER_LESS_THAN'
    									| 'POWER_GREATER_THAN'
    									| 'REPETITION_TIME'
    									| 'REPS'
    									| 'FIXED_REST'
    									| 'TIME_AT_VALID_CDA'
    									| 'STEPS'
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Type of condition that must be fulfilled to consider the workout step complete
    								 */
    								duration_type?:
    									| 'TIME'
    									| 'DISTANCE_METERS'
    									| 'HR_LESS_THAN'
    									| 'HR_GREATER_THAN'
    									| 'CALORIES'
    									| 'OPEN'
    									| 'POWER_LESS_THAN'
    									| 'POWER_GREATER_THAN'
    									| 'REPETITION_TIME'
    									| 'REPS'
    									| 'FIXED_REST'
    									| 'TIME_AT_VALID_CDA'
    									| 'STEPS'
    								/**
    								 * Target distance for the workout step - once the user covers this distance, the step will be completed
    								 */
    								distance_meters?: number
    								[k: string]: unknown
    						  }
    						| {
    								/**
    								 * Target number of steps for the workout step - once the user performs this number of steps, the step will be completed
    								 */
    								steps?: number
    								/**
    								 * Type of condition that must be fulfilled to consider the workout step complete
    								 */
    								duration_type?:
    									| 'TIME'
    									| 'DISTANCE_METERS'
    									| 'HR_LESS_THAN'
    									| 'HR_GREATER_THAN'
    									| 'CALORIES'
    									| 'OPEN'
    									| 'POWER_LESS_THAN'
    									| 'POWER_GREATER_THAN'
    									| 'REPETITION_TIME'
    									| 'REPS'
    									| 'FIXED_REST'
    									| 'TIME_AT_VALID_CDA'
    									| 'STEPS'
    								[k: string]: unknown
    						  }
    					)[]
    					/**
    					 * Name of workout step
    					 */
    					name?: string
    					[k: string]: unknown
    			  }
    			| {
    					/**
    					 * List of targets for the workout
    					 */
    					targets?: {
    						/**
    						 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    						 */
    						target_type?:
    							| 'SPEED'
    							| 'HEART_RATE'
    							| 'OPEN'
    							| 'CADENCE'
    							| 'POWER'
    							| 'GRADE'
    							| 'RESISTANCE'
    							| 'POWER_LAP'
    							| 'SWIM_STROKE'
    							| 'SPEED_LAP'
    							| 'HEART_RATE_LAP'
    							| 'PACE'
    							| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    							| 'HEART_RATE_MAX_PERCENTAGE'
    							| 'SPEED_PERCENTAGE'
    							| 'POWER_PERCENTAGE'
    							| 'REPETITION'
    							| 'TSS'
    							| 'IF'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Type of workout step - either repeat or one-off
    					 */
    					type?: 'STEP' | 'REPEAT_STEP'
    					/**
    					 * List of steps to be repeated for this workout step - e.g. if a user wants to schedule 5 repetitions of 100m sprints plus 20s rest in between
    					 */
    					steps?: {
    						/**
    						 * List of targets for the workout
    						 */
    						targets?: (
    							| {
    									/**
    									 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    									 */
    									target_type?:
    										| 'SPEED'
    										| 'HEART_RATE'
    										| 'OPEN'
    										| 'CADENCE'
    										| 'POWER'
    										| 'GRADE'
    										| 'RESISTANCE'
    										| 'POWER_LAP'
    										| 'SWIM_STROKE'
    										| 'SPEED_LAP'
    										| 'HEART_RATE_LAP'
    										| 'PACE'
    										| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    										| 'HEART_RATE_MAX_PERCENTAGE'
    										| 'SPEED_PERCENTAGE'
    										| 'POWER_PERCENTAGE'
    										| 'REPETITION'
    										| 'TSS'
    										| 'IF'
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Ideal cadence value to be maintained for the workout step
    									 */
    									cadence?: number
    									/**
    									 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    									 */
    									target_type?:
    										| 'SPEED'
    										| 'HEART_RATE'
    										| 'OPEN'
    										| 'CADENCE'
    										| 'POWER'
    										| 'GRADE'
    										| 'RESISTANCE'
    										| 'POWER_LAP'
    										| 'SWIM_STROKE'
    										| 'SPEED_LAP'
    										| 'HEART_RATE_LAP'
    										| 'PACE'
    										| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    										| 'HEART_RATE_MAX_PERCENTAGE'
    										| 'SPEED_PERCENTAGE'
    										| 'POWER_PERCENTAGE'
    										| 'REPETITION'
    										| 'TSS'
    										| 'IF'
    									/**
    									 * Minimum cadence threshold for the workout step - i.e. the user is to stay above this value during the workout
    									 */
    									cadence_low?: number
    									/**
    									 * Maximum cadence threshold for the workout step - i.e. the user is to stay under this value during the workout step
    									 */
    									cadence_high?: number
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Maximum max heart rate percentage threshold for the workout step - i.e. the user is to stay under this value during the workout step
    									 */
    									hr_percentage_low?: number
    									/**
    									 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    									 */
    									target_type?:
    										| 'SPEED'
    										| 'HEART_RATE'
    										| 'OPEN'
    										| 'CADENCE'
    										| 'POWER'
    										| 'GRADE'
    										| 'RESISTANCE'
    										| 'POWER_LAP'
    										| 'SWIM_STROKE'
    										| 'SPEED_LAP'
    										| 'HEART_RATE_LAP'
    										| 'PACE'
    										| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    										| 'HEART_RATE_MAX_PERCENTAGE'
    										| 'SPEED_PERCENTAGE'
    										| 'POWER_PERCENTAGE'
    										| 'REPETITION'
    										| 'TSS'
    										| 'IF'
    									/**
    									 * Minimum heart rate percentage threshold for the workout step - i.e. the user is to stay above this value during the workout
    									 */
    									hr_percentage_high?: number
    									/**
    									 * Ideal percentage of user's maximum HR to be maintained workout step
    									 */
    									hr_percentage?: number
    									/**
    									 * Maximum heart rate threshold for the workout step - i.e. the user is to stay under this value during the workout step
    									 */
    									hr_bpm_high?: number
    									/**
    									 * Minimum heart rate threshold for the workout step - i.e. the user is to stay above this value during the workout
    									 */
    									hr_bpm_low?: number
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    									 */
    									target_type?:
    										| 'SPEED'
    										| 'HEART_RATE'
    										| 'OPEN'
    										| 'CADENCE'
    										| 'POWER'
    										| 'GRADE'
    										| 'RESISTANCE'
    										| 'POWER_LAP'
    										| 'SWIM_STROKE'
    										| 'SPEED_LAP'
    										| 'HEART_RATE_LAP'
    										| 'PACE'
    										| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    										| 'HEART_RATE_MAX_PERCENTAGE'
    										| 'SPEED_PERCENTAGE'
    										| 'POWER_PERCENTAGE'
    										| 'REPETITION'
    										| 'TSS'
    										| 'IF'
    									/**
    									 * Maximum percentage of Functional Threshold Power for the workout step - i.e. the user is to stay under this value during the workout step
    									 */
    									power_percentage_low?: number
    									/**
    									 * Minimum percentage of Functional Threshold Power for the workout step - i.e. the user is to stay above this value during the workout
    									 */
    									power_percentage_high?: number
    									/**
    									 * Maximum power threshold for the workout step - i.e. the user is to stay under this value during the workout step
    									 */
    									power_watt_high?: number
    									/**
    									 * Minimum power threshold for the workout step - i.e. the user is to stay above this value during the workout
    									 */
    									power_watt_low?: number
    									power_watt?: number
    									/**
    									 * Ideal percentage of user's Functional Threshold Power to be maintained workout step
    									 */
    									power_percentage?: number
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    									 */
    									target_type?:
    										| 'SPEED'
    										| 'HEART_RATE'
    										| 'OPEN'
    										| 'CADENCE'
    										| 'POWER'
    										| 'GRADE'
    										| 'RESISTANCE'
    										| 'POWER_LAP'
    										| 'SWIM_STROKE'
    										| 'SPEED_LAP'
    										| 'HEART_RATE_LAP'
    										| 'PACE'
    										| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    										| 'HEART_RATE_MAX_PERCENTAGE'
    										| 'SPEED_PERCENTAGE'
    										| 'POWER_PERCENTAGE'
    										| 'REPETITION'
    										| 'TSS'
    										| 'IF'
    									/**
    									 * Maximum speed threshold for the workout step - i.e. the user is to stay under this value during the workout step
    									 */
    									speed_percentage_high?: number
    									/**
    									 * Minimum speed threshold for the workout step - i.e. the user is to stay above this value during the workout step
    									 */
    									speed_percentage_low?: number
    									/**
    									 * Ideal percentage of user's Threshold Speed, based off their Threshold Pace, to be maintained workout step. Usually, the Threshold Pace is defined as the pace one could race at for 50 to 60 minutes
    									 */
    									speed_percentage?: number
    									/**
    									 * Ideal speed value to be maintained for the workout step
    									 */
    									speed_meters_per_second?: number
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    									 */
    									target_type?:
    										| 'SPEED'
    										| 'HEART_RATE'
    										| 'OPEN'
    										| 'CADENCE'
    										| 'POWER'
    										| 'GRADE'
    										| 'RESISTANCE'
    										| 'POWER_LAP'
    										| 'SWIM_STROKE'
    										| 'SPEED_LAP'
    										| 'HEART_RATE_LAP'
    										| 'PACE'
    										| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    										| 'HEART_RATE_MAX_PERCENTAGE'
    										| 'SPEED_PERCENTAGE'
    										| 'POWER_PERCENTAGE'
    										| 'REPETITION'
    										| 'TSS'
    										| 'IF'
    									/**
    									 * Ideal pace value to be maintained for the workout step
    									 */
    									pace_minutes_per_kilometer?: number
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    									 */
    									target_type?:
    										| 'SPEED'
    										| 'HEART_RATE'
    										| 'OPEN'
    										| 'CADENCE'
    										| 'POWER'
    										| 'GRADE'
    										| 'RESISTANCE'
    										| 'POWER_LAP'
    										| 'SWIM_STROKE'
    										| 'SPEED_LAP'
    										| 'HEART_RATE_LAP'
    										| 'PACE'
    										| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    										| 'HEART_RATE_MAX_PERCENTAGE'
    										| 'SPEED_PERCENTAGE'
    										| 'POWER_PERCENTAGE'
    										| 'REPETITION'
    										| 'TSS'
    										| 'IF'
    									/**
    									 * Planned Training Stress Score to be achieved for the workout step
    									 */
    									tss?: number
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Maximum Intensity Factor to be achieved for the workout step
    									 */
    									if_high?: number
    									/**
    									 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    									 */
    									target_type?:
    										| 'SPEED'
    										| 'HEART_RATE'
    										| 'OPEN'
    										| 'CADENCE'
    										| 'POWER'
    										| 'GRADE'
    										| 'RESISTANCE'
    										| 'POWER_LAP'
    										| 'SWIM_STROKE'
    										| 'SPEED_LAP'
    										| 'HEART_RATE_LAP'
    										| 'PACE'
    										| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    										| 'HEART_RATE_MAX_PERCENTAGE'
    										| 'SPEED_PERCENTAGE'
    										| 'POWER_PERCENTAGE'
    										| 'REPETITION'
    										| 'TSS'
    										| 'IF'
    									/**
    									 * Minimum Intensity Factor to be achieved for the workout step
    									 */
    									if_low?: number
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    									 */
    									target_type?:
    										| 'SPEED'
    										| 'HEART_RATE'
    										| 'OPEN'
    										| 'CADENCE'
    										| 'POWER'
    										| 'GRADE'
    										| 'RESISTANCE'
    										| 'POWER_LAP'
    										| 'SWIM_STROKE'
    										| 'SPEED_LAP'
    										| 'HEART_RATE_LAP'
    										| 'PACE'
    										| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    										| 'HEART_RATE_MAX_PERCENTAGE'
    										| 'SPEED_PERCENTAGE'
    										| 'POWER_PERCENTAGE'
    										| 'REPETITION'
    										| 'TSS'
    										| 'IF'
    									/**
    									 * Number of repetitions of the workout step to be performed
    									 */
    									repetitions?: number
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    									 */
    									target_type?:
    										| 'SPEED'
    										| 'HEART_RATE'
    										| 'OPEN'
    										| 'CADENCE'
    										| 'POWER'
    										| 'GRADE'
    										| 'RESISTANCE'
    										| 'POWER_LAP'
    										| 'SWIM_STROKE'
    										| 'SPEED_LAP'
    										| 'HEART_RATE_LAP'
    										| 'PACE'
    										| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    										| 'HEART_RATE_MAX_PERCENTAGE'
    										| 'SPEED_PERCENTAGE'
    										| 'POWER_PERCENTAGE'
    										| 'REPETITION'
    										| 'TSS'
    										| 'IF'
    									/**
    									 * Number of swim strokes to be performed during the workout step
    									 */
    									swim_strokes?: number
    									[k: string]: unknown
    							  }
    						)[]
    						/**
    						 * Type of workout step - either repeat or one-off
    						 */
    						type?: 'STEP' | 'REPEAT_STEP'
    						/**
    						 * Planned intensity for the workout step
    						 */
    						intensity?: 'REST' | 'WARMUP' | 'COOLDOWN' | 'RECOVERY' | 'INTERVAL' | 'ACTIVE'
    						/**
    						 * Position of the workout step in the overall workout
    						 */
    						order?: number
    						/**
    						 * Description of workout step
    						 */
    						description?: string
    						/**
    						 * List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed
    						 */
    						durations?: (
    							| {
    									/**
    									 * Type of condition that must be fulfilled to consider the workout step complete
    									 */
    									duration_type?:
    										| 'TIME'
    										| 'DISTANCE_METERS'
    										| 'HR_LESS_THAN'
    										| 'HR_GREATER_THAN'
    										| 'CALORIES'
    										| 'OPEN'
    										| 'POWER_LESS_THAN'
    										| 'POWER_GREATER_THAN'
    										| 'REPETITION_TIME'
    										| 'REPS'
    										| 'FIXED_REST'
    										| 'TIME_AT_VALID_CDA'
    										| 'STEPS'
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Time duration to be elapsed for the workout step
    									 */
    									seconds?: number
    									/**
    									 * Type of condition that must be fulfilled to consider the workout step complete
    									 */
    									duration_type?:
    										| 'TIME'
    										| 'DISTANCE_METERS'
    										| 'HR_LESS_THAN'
    										| 'HR_GREATER_THAN'
    										| 'CALORIES'
    										| 'OPEN'
    										| 'POWER_LESS_THAN'
    										| 'POWER_GREATER_THAN'
    										| 'REPETITION_TIME'
    										| 'REPS'
    										| 'FIXED_REST'
    										| 'TIME_AT_VALID_CDA'
    										| 'STEPS'
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Threshold power goal to complete the workout step - once the user reaches above this power level, the step will be completed
    									 */
    									power_above_watts?: number
    									/**
    									 * Type of condition that must be fulfilled to consider the workout step complete
    									 */
    									duration_type?:
    										| 'TIME'
    										| 'DISTANCE_METERS'
    										| 'HR_LESS_THAN'
    										| 'HR_GREATER_THAN'
    										| 'CALORIES'
    										| 'OPEN'
    										| 'POWER_LESS_THAN'
    										| 'POWER_GREATER_THAN'
    										| 'REPETITION_TIME'
    										| 'REPS'
    										| 'FIXED_REST'
    										| 'TIME_AT_VALID_CDA'
    										| 'STEPS'
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Threshold power goal to complete the workout step - once the user reaches below this power level, the step will be completed
    									 */
    									power_below_watts?: number
    									/**
    									 * Type of condition that must be fulfilled to consider the workout step complete
    									 */
    									duration_type?:
    										| 'TIME'
    										| 'DISTANCE_METERS'
    										| 'HR_LESS_THAN'
    										| 'HR_GREATER_THAN'
    										| 'CALORIES'
    										| 'OPEN'
    										| 'POWER_LESS_THAN'
    										| 'POWER_GREATER_THAN'
    										| 'REPETITION_TIME'
    										| 'REPS'
    										| 'FIXED_REST'
    										| 'TIME_AT_VALID_CDA'
    										| 'STEPS'
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Type of condition that must be fulfilled to consider the workout step complete
    									 */
    									duration_type?:
    										| 'TIME'
    										| 'DISTANCE_METERS'
    										| 'HR_LESS_THAN'
    										| 'HR_GREATER_THAN'
    										| 'CALORIES'
    										| 'OPEN'
    										| 'POWER_LESS_THAN'
    										| 'POWER_GREATER_THAN'
    										| 'REPETITION_TIME'
    										| 'REPS'
    										| 'FIXED_REST'
    										| 'TIME_AT_VALID_CDA'
    										| 'STEPS'
    									/**
    									 * Time duration to be elapsed for the rest period
    									 */
    									rest_seconds?: number
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Calorie burn target for the workout step - once the user reaches the target, the step will be completed
    									 */
    									calories?: number
    									/**
    									 * Type of condition that must be fulfilled to consider the workout step complete
    									 */
    									duration_type?:
    										| 'TIME'
    										| 'DISTANCE_METERS'
    										| 'HR_LESS_THAN'
    										| 'HR_GREATER_THAN'
    										| 'CALORIES'
    										| 'OPEN'
    										| 'POWER_LESS_THAN'
    										| 'POWER_GREATER_THAN'
    										| 'REPETITION_TIME'
    										| 'REPS'
    										| 'FIXED_REST'
    										| 'TIME_AT_VALID_CDA'
    										| 'STEPS'
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Type of condition that must be fulfilled to consider the workout step complete
    									 */
    									duration_type?:
    										| 'TIME'
    										| 'DISTANCE_METERS'
    										| 'HR_LESS_THAN'
    										| 'HR_GREATER_THAN'
    										| 'CALORIES'
    										| 'OPEN'
    										| 'POWER_LESS_THAN'
    										| 'POWER_GREATER_THAN'
    										| 'REPETITION_TIME'
    										| 'REPS'
    										| 'FIXED_REST'
    										| 'TIME_AT_VALID_CDA'
    										| 'STEPS'
    									/**
    									 * Threshold heart rate goal to complete the workout step - once the user's heart rate reaches above below this value, the step will be completed
    									 */
    									hr_above_bpm?: number
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Threshold heart rate goal to complete the workout step - once the user's heart rate reaches below this value, the step will be completed
    									 */
    									hr_below_bpm?: number
    									/**
    									 * Type of condition that must be fulfilled to consider the workout step complete
    									 */
    									duration_type?:
    										| 'TIME'
    										| 'DISTANCE_METERS'
    										| 'HR_LESS_THAN'
    										| 'HR_GREATER_THAN'
    										| 'CALORIES'
    										| 'OPEN'
    										| 'POWER_LESS_THAN'
    										| 'POWER_GREATER_THAN'
    										| 'REPETITION_TIME'
    										| 'REPS'
    										| 'FIXED_REST'
    										| 'TIME_AT_VALID_CDA'
    										| 'STEPS'
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Target number of reps for the workout step - once the user completes this rep target, the step will be completed
    									 */
    									reps?: number
    									/**
    									 * Type of condition that must be fulfilled to consider the workout step complete
    									 */
    									duration_type?:
    										| 'TIME'
    										| 'DISTANCE_METERS'
    										| 'HR_LESS_THAN'
    										| 'HR_GREATER_THAN'
    										| 'CALORIES'
    										| 'OPEN'
    										| 'POWER_LESS_THAN'
    										| 'POWER_GREATER_THAN'
    										| 'REPETITION_TIME'
    										| 'REPS'
    										| 'FIXED_REST'
    										| 'TIME_AT_VALID_CDA'
    										| 'STEPS'
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Type of condition that must be fulfilled to consider the workout step complete
    									 */
    									duration_type?:
    										| 'TIME'
    										| 'DISTANCE_METERS'
    										| 'HR_LESS_THAN'
    										| 'HR_GREATER_THAN'
    										| 'CALORIES'
    										| 'OPEN'
    										| 'POWER_LESS_THAN'
    										| 'POWER_GREATER_THAN'
    										| 'REPETITION_TIME'
    										| 'REPS'
    										| 'FIXED_REST'
    										| 'TIME_AT_VALID_CDA'
    										| 'STEPS'
    									/**
    									 * Target distance for the workout step - once the user covers this distance, the step will be completed
    									 */
    									distance_meters?: number
    									[k: string]: unknown
    							  }
    							| {
    									/**
    									 * Target number of steps for the workout step - once the user performs this number of steps, the step will be completed
    									 */
    									steps?: number
    									/**
    									 * Type of condition that must be fulfilled to consider the workout step complete
    									 */
    									duration_type?:
    										| 'TIME'
    										| 'DISTANCE_METERS'
    										| 'HR_LESS_THAN'
    										| 'HR_GREATER_THAN'
    										| 'CALORIES'
    										| 'OPEN'
    										| 'POWER_LESS_THAN'
    										| 'POWER_GREATER_THAN'
    										| 'REPETITION_TIME'
    										| 'REPS'
    										| 'FIXED_REST'
    										| 'TIME_AT_VALID_CDA'
    										| 'STEPS'
    									[k: string]: unknown
    							  }
    						)[]
    						/**
    						 * Name of workout step
    						 */
    						name?: string
    						[k: string]: unknown
    					}[]
    					/**
    					 * Planned intensity for the workout step
    					 */
    					intensity?: number
    					/**
    					 * Position of the workout step in the overall workout
    					 */
    					order?: number
    					/**
    					 * Description of workout step
    					 */
    					description?: string
    					/**
    					 * List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed
    					 */
    					durations?: {
    						/**
    						 * Type of condition that must be fulfilled to consider the workout step complete
    						 */
    						duration_type?:
    							| 'TIME'
    							| 'DISTANCE_METERS'
    							| 'HR_LESS_THAN'
    							| 'HR_GREATER_THAN'
    							| 'CALORIES'
    							| 'OPEN'
    							| 'POWER_LESS_THAN'
    							| 'POWER_GREATER_THAN'
    							| 'REPETITION_TIME'
    							| 'REPS'
    							| 'FIXED_REST'
    							| 'TIME_AT_VALID_CDA'
    							| 'STEPS'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Name of workout step
    					 */
    					name?: string
    					[k: string]: unknown
    			  }
    			| {
    					/**
    					 * List of targets for the workout
    					 */
    					targets?: {
    						/**
    						 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    						 */
    						target_type?:
    							| 'SPEED'
    							| 'HEART_RATE'
    							| 'OPEN'
    							| 'CADENCE'
    							| 'POWER'
    							| 'GRADE'
    							| 'RESISTANCE'
    							| 'POWER_LAP'
    							| 'SWIM_STROKE'
    							| 'SPEED_LAP'
    							| 'HEART_RATE_LAP'
    							| 'PACE'
    							| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    							| 'HEART_RATE_MAX_PERCENTAGE'
    							| 'SPEED_PERCENTAGE'
    							| 'POWER_PERCENTAGE'
    							| 'REPETITION'
    							| 'TSS'
    							| 'IF'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Type of workout step - either repeat or one-off
    					 */
    					type?: 'STEP' | 'REPEAT_STEP'
    					/**
    					 * Planned intensity for the workout step
    					 */
    					intensity?: number
    					/**
    					 * Position of the workout step in the overall workout
    					 */
    					order?: number
    					/**
    					 * Workout equipment to be used during the workout step
    					 */
    					equipment_type?:
    						| 'NONE'
    						| 'SWIM_FINS'
    						| 'SWIM_KICKBOARD'
    						| 'SWIM_PADDLES'
    						| 'SWIM_PULL_BUOY'
    						| 'SWIM_SNORKEL'
    					/**
    					 * Description of workout step
    					 */
    					description?: string
    					/**
    					 * List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed
    					 */
    					durations?: {
    						/**
    						 * Type of condition that must be fulfilled to consider the workout step complete
    						 */
    						duration_type?:
    							| 'TIME'
    							| 'DISTANCE_METERS'
    							| 'HR_LESS_THAN'
    							| 'HR_GREATER_THAN'
    							| 'CALORIES'
    							| 'OPEN'
    							| 'POWER_LESS_THAN'
    							| 'POWER_GREATER_THAN'
    							| 'REPETITION_TIME'
    							| 'REPS'
    							| 'FIXED_REST'
    							| 'TIME_AT_VALID_CDA'
    							| 'STEPS'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Name of workout step
    					 */
    					name?: string
    					/**
    					 * Stroke type used for the workout step (e.g. breaststroke)
    					 */
    					stroke_type?: 'OTHER' | 'FREESTYLE' | 'BACKSTROKE' | 'BREASTSTROKE' | 'BUTTERFLY' | 'REST'
    					[k: string]: unknown
    			  }
    			| {
    					/**
    					 * List of targets for the workout
    					 */
    					targets?: {
    						/**
    						 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    						 */
    						target_type?:
    							| 'SPEED'
    							| 'HEART_RATE'
    							| 'OPEN'
    							| 'CADENCE'
    							| 'POWER'
    							| 'GRADE'
    							| 'RESISTANCE'
    							| 'POWER_LAP'
    							| 'SWIM_STROKE'
    							| 'SPEED_LAP'
    							| 'HEART_RATE_LAP'
    							| 'PACE'
    							| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    							| 'HEART_RATE_MAX_PERCENTAGE'
    							| 'SPEED_PERCENTAGE'
    							| 'POWER_PERCENTAGE'
    							| 'REPETITION'
    							| 'TSS'
    							| 'IF'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Type of workout step - either repeat or one-off
    					 */
    					type?: 'STEP' | 'REPEAT_STEP'
    					/**
    					 * Planned intensity for the workout step
    					 */
    					intensity?: number
    					/**
    					 * Position of the workout step in the overall workout
    					 */
    					order?: number
    					/**
    					 * Name of exercise to be performed for the workout step
    					 */
    					exercise_name?: string
    					/**
    					 * Description of workout step
    					 */
    					description?: string
    					/**
    					 * List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed
    					 */
    					durations?: {
    						/**
    						 * Type of condition that must be fulfilled to consider the workout step complete
    						 */
    						duration_type?:
    							| 'TIME'
    							| 'DISTANCE_METERS'
    							| 'HR_LESS_THAN'
    							| 'HR_GREATER_THAN'
    							| 'CALORIES'
    							| 'OPEN'
    							| 'POWER_LESS_THAN'
    							| 'POWER_GREATER_THAN'
    							| 'REPETITION_TIME'
    							| 'REPS'
    							| 'FIXED_REST'
    							| 'TIME_AT_VALID_CDA'
    							| 'STEPS'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Type of exercise to be performed for the workout step
    					 */
    					exercise_category?:
    						| 'UNKNOWN'
    						| 'BENCH_PRESS'
    						| 'CALF_RAISE'
    						| 'CARDIO'
    						| 'CARRY'
    						| 'CHOP'
    						| 'CORE'
    						| 'CRUNCH'
    						| 'CURL'
    						| 'DEADLIFT'
    						| 'FLYE'
    						| 'HIP_RAISE'
    						| 'HIP_STABILITY'
    						| 'HIP_SWING'
    						| 'HYPEREXTENSION'
    						| 'LATERAL_RAISE'
    						| 'LEG_CURL'
    						| 'LEG_RAISE'
    						| 'LUNGE'
    						| 'OLYMPIC_LIFT'
    						| 'PLANK'
    						| 'PLYO'
    						| 'PULL_UP'
    						| 'PUSH_UP'
    						| 'ROW'
    						| 'SHOULDER_PRESS'
    						| 'SHOULDER_STABILITY'
    						| 'SHRUG'
    						| 'SIT_UP'
    						| 'SQUAT'
    						| 'TOTAL_BODY'
    						| 'TRICEPS_EXTENSION'
    						| 'WARM_UP'
    						| 'RUN'
    						| 'BIKE'
    						| 'CARDIO_SENSORS'
    					/**
    					 * Name of workout step
    					 */
    					name?: string
    					[k: string]: unknown
    			  }
    			| {
    					/**
    					 * Weight to be lifted for the exercise
    					 */
    					weight_kg?: number
    					/**
    					 * List of targets for the workout
    					 */
    					targets?: {
    						/**
    						 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    						 */
    						target_type?:
    							| 'SPEED'
    							| 'HEART_RATE'
    							| 'OPEN'
    							| 'CADENCE'
    							| 'POWER'
    							| 'GRADE'
    							| 'RESISTANCE'
    							| 'POWER_LAP'
    							| 'SWIM_STROKE'
    							| 'SPEED_LAP'
    							| 'HEART_RATE_LAP'
    							| 'PACE'
    							| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    							| 'HEART_RATE_MAX_PERCENTAGE'
    							| 'SPEED_PERCENTAGE'
    							| 'POWER_PERCENTAGE'
    							| 'REPETITION'
    							| 'TSS'
    							| 'IF'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Type of workout step - either repeat or one-off
    					 */
    					type?: 'STEP' | 'REPEAT_STEP'
    					/**
    					 * Planned intensity for the workout step
    					 */
    					intensity?: number
    					/**
    					 * Position of the workout step in the overall workout
    					 */
    					order?: number
    					/**
    					 * Name of strength exercise to be performed for the workout step
    					 */
    					exercise_name?: string
    					/**
    					 * Description of workout step
    					 */
    					description?: string
    					/**
    					 * List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed
    					 */
    					durations?: {
    						/**
    						 * Type of condition that must be fulfilled to consider the workout step complete
    						 */
    						duration_type?:
    							| 'TIME'
    							| 'DISTANCE_METERS'
    							| 'HR_LESS_THAN'
    							| 'HR_GREATER_THAN'
    							| 'CALORIES'
    							| 'OPEN'
    							| 'POWER_LESS_THAN'
    							| 'POWER_GREATER_THAN'
    							| 'REPETITION_TIME'
    							| 'REPS'
    							| 'FIXED_REST'
    							| 'TIME_AT_VALID_CDA'
    							| 'STEPS'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Type of strength exercise to be performed for the workout step
    					 */
    					exercise_category?:
    						| 'UNKNOWN'
    						| 'BENCH_PRESS'
    						| 'CALF_RAISE'
    						| 'CARDIO'
    						| 'CARRY'
    						| 'CHOP'
    						| 'CORE'
    						| 'CRUNCH'
    						| 'CURL'
    						| 'DEADLIFT'
    						| 'FLYE'
    						| 'HIP_RAISE'
    						| 'HIP_STABILITY'
    						| 'HIP_SWING'
    						| 'HYPEREXTENSION'
    						| 'LATERAL_RAISE'
    						| 'LEG_CURL'
    						| 'LEG_RAISE'
    						| 'LUNGE'
    						| 'OLYMPIC_LIFT'
    						| 'PLANK'
    						| 'PLYO'
    						| 'PULL_UP'
    						| 'PUSH_UP'
    						| 'ROW'
    						| 'SHOULDER_PRESS'
    						| 'SHOULDER_STABILITY'
    						| 'SHRUG'
    						| 'SIT_UP'
    						| 'SQUAT'
    						| 'TOTAL_BODY'
    						| 'TRICEPS_EXTENSION'
    						| 'WARM_UP'
    						| 'RUN'
    						| 'BIKE'
    						| 'CARDIO_SENSORS'
    					/**
    					 * Name of workout step
    					 */
    					name?: string
    					[k: string]: unknown
    			  }
    			| {
    					/**
    					 * List of targets for the workout
    					 */
    					targets?: {
    						/**
    						 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    						 */
    						target_type?:
    							| 'SPEED'
    							| 'HEART_RATE'
    							| 'OPEN'
    							| 'CADENCE'
    							| 'POWER'
    							| 'GRADE'
    							| 'RESISTANCE'
    							| 'POWER_LAP'
    							| 'SWIM_STROKE'
    							| 'SPEED_LAP'
    							| 'HEART_RATE_LAP'
    							| 'PACE'
    							| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    							| 'HEART_RATE_MAX_PERCENTAGE'
    							| 'SPEED_PERCENTAGE'
    							| 'POWER_PERCENTAGE'
    							| 'REPETITION'
    							| 'TSS'
    							| 'IF'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Type of workout step - either repeat or one-off
    					 */
    					type?: 'STEP' | 'REPEAT_STEP'
    					/**
    					 * Planned intensity for the workout step
    					 */
    					intensity?: number
    					/**
    					 * Position of the workout step in the overall workout
    					 */
    					order?: number
    					/**
    					 * Description of workout step
    					 */
    					description?: string
    					/**
    					 * List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed
    					 */
    					durations?: {
    						/**
    						 * Type of condition that must be fulfilled to consider the workout step complete
    						 */
    						duration_type?:
    							| 'TIME'
    							| 'DISTANCE_METERS'
    							| 'HR_LESS_THAN'
    							| 'HR_GREATER_THAN'
    							| 'CALORIES'
    							| 'OPEN'
    							| 'POWER_LESS_THAN'
    							| 'POWER_GREATER_THAN'
    							| 'REPETITION_TIME'
    							| 'REPS'
    							| 'FIXED_REST'
    							| 'TIME_AT_VALID_CDA'
    							| 'STEPS'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Name of workout step
    					 */
    					name?: string
    					[k: string]: unknown
    			  }
    			| {
    					/**
    					 * List of targets for the workout
    					 */
    					targets?: {
    						/**
    						 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    						 */
    						target_type?:
    							| 'SPEED'
    							| 'HEART_RATE'
    							| 'OPEN'
    							| 'CADENCE'
    							| 'POWER'
    							| 'GRADE'
    							| 'RESISTANCE'
    							| 'POWER_LAP'
    							| 'SWIM_STROKE'
    							| 'SPEED_LAP'
    							| 'HEART_RATE_LAP'
    							| 'PACE'
    							| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    							| 'HEART_RATE_MAX_PERCENTAGE'
    							| 'SPEED_PERCENTAGE'
    							| 'POWER_PERCENTAGE'
    							| 'REPETITION'
    							| 'TSS'
    							| 'IF'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Type of workout step - either repeat or one-off
    					 */
    					type?: 'STEP' | 'REPEAT_STEP'
    					/**
    					 * Planned intensity for the workout step
    					 */
    					intensity?: number
    					/**
    					 * Position of the workout step in the overall workout
    					 */
    					order?: number
    					/**
    					 * Description of workout step
    					 */
    					description?: string
    					/**
    					 * List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed
    					 */
    					durations?: {
    						/**
    						 * Type of condition that must be fulfilled to consider the workout step complete
    						 */
    						duration_type?:
    							| 'TIME'
    							| 'DISTANCE_METERS'
    							| 'HR_LESS_THAN'
    							| 'HR_GREATER_THAN'
    							| 'CALORIES'
    							| 'OPEN'
    							| 'POWER_LESS_THAN'
    							| 'POWER_GREATER_THAN'
    							| 'REPETITION_TIME'
    							| 'REPS'
    							| 'FIXED_REST'
    							| 'TIME_AT_VALID_CDA'
    							| 'STEPS'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Name of workout step
    					 */
    					name?: string
    					[k: string]: unknown
    			  }
    			| {
    					/**
    					 * List of targets for the workout
    					 */
    					targets?: {
    						/**
    						 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    						 */
    						target_type?:
    							| 'SPEED'
    							| 'HEART_RATE'
    							| 'OPEN'
    							| 'CADENCE'
    							| 'POWER'
    							| 'GRADE'
    							| 'RESISTANCE'
    							| 'POWER_LAP'
    							| 'SWIM_STROKE'
    							| 'SPEED_LAP'
    							| 'HEART_RATE_LAP'
    							| 'PACE'
    							| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    							| 'HEART_RATE_MAX_PERCENTAGE'
    							| 'SPEED_PERCENTAGE'
    							| 'POWER_PERCENTAGE'
    							| 'REPETITION'
    							| 'TSS'
    							| 'IF'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Type of workout step - either repeat or one-off
    					 */
    					type?: 'STEP' | 'REPEAT_STEP'
    					/**
    					 * Planned intensity for the workout step
    					 */
    					intensity?: number
    					/**
    					 * Position of the workout step in the overall workout
    					 */
    					order?: number
    					/**
    					 * Description of workout step
    					 */
    					description?: string
    					/**
    					 * List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed
    					 */
    					durations?: {
    						/**
    						 * Type of condition that must be fulfilled to consider the workout step complete
    						 */
    						duration_type?:
    							| 'TIME'
    							| 'DISTANCE_METERS'
    							| 'HR_LESS_THAN'
    							| 'HR_GREATER_THAN'
    							| 'CALORIES'
    							| 'OPEN'
    							| 'POWER_LESS_THAN'
    							| 'POWER_GREATER_THAN'
    							| 'REPETITION_TIME'
    							| 'REPS'
    							| 'FIXED_REST'
    							| 'TIME_AT_VALID_CDA'
    							| 'STEPS'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Name of workout step
    					 */
    					name?: string
    					[k: string]: unknown
    			  }
    			| {
    					/**
    					 * List of targets for the workout
    					 */
    					targets?: {
    						/**
    						 * Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed
    						 */
    						target_type?:
    							| 'SPEED'
    							| 'HEART_RATE'
    							| 'OPEN'
    							| 'CADENCE'
    							| 'POWER'
    							| 'GRADE'
    							| 'RESISTANCE'
    							| 'POWER_LAP'
    							| 'SWIM_STROKE'
    							| 'SPEED_LAP'
    							| 'HEART_RATE_LAP'
    							| 'PACE'
    							| 'HEART_RATE_THRESHOLD_PERCENTAGE'
    							| 'HEART_RATE_MAX_PERCENTAGE'
    							| 'SPEED_PERCENTAGE'
    							| 'POWER_PERCENTAGE'
    							| 'REPETITION'
    							| 'TSS'
    							| 'IF'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Type of workout step - either repeat or one-off
    					 */
    					type?: 'STEP' | 'REPEAT_STEP'
    					/**
    					 * Planned intensity for the workout step
    					 */
    					intensity?: number
    					/**
    					 * Position of the workout step in the overall workout
    					 */
    					order?: number
    					/**
    					 * Description of workout step
    					 */
    					description?: string
    					/**
    					 * List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed
    					 */
    					durations?: {
    						/**
    						 * Type of condition that must be fulfilled to consider the workout step complete
    						 */
    						duration_type?:
    							| 'TIME'
    							| 'DISTANCE_METERS'
    							| 'HR_LESS_THAN'
    							| 'HR_GREATER_THAN'
    							| 'CALORIES'
    							| 'OPEN'
    							| 'POWER_LESS_THAN'
    							| 'POWER_GREATER_THAN'
    							| 'REPETITION_TIME'
    							| 'REPS'
    							| 'FIXED_REST'
    							| 'TIME_AT_VALID_CDA'
    							| 'STEPS'
    						[k: string]: unknown
    					}[]
    					/**
    					 * Name of workout step
    					 */
    					name?: string
    					[k: string]: unknown
    			  }
    		)[]
    		/**
    		 * Metadata for the workout plan
    		 */
    		metadata?: {
    			/**
    			 * Estimated energy expenditure for the workout
    			 */
    			estimated_energy_kj?: number | null
    			/**
    			 * Estimated speed for the workout
    			 */
    			estimated_speed_meters_per_second?: number | null
    			/**
    			 * Estimated elevation gain for the workout
    			 */
    			estimated_elevation_gain_meters?: number | null
    			/**
    			 * Estimated Training Stress Score for the workout
    			 */
    			estimated_tss?: number | null
    			/**
    			 * Estimated calorie burn for the workout
    			 */
    			estimated_calories?: number | null
    			/**
    			 * The creation datetime of the associated workout, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time
    			 */
    			created_date?: string | null
    			/**
    			 * The planned start datetime, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time
    			 */
    			planned_date?: string
    			/**
    			 * The name - either user-entered or given by the fitness data provider - of the associated workout plan
    			 */
    			type?:
    				| 'IN_VEHICLE'
    				| 'BIKING'
    				| 'STILL'
    				| 'UNKNOWN'
    				| 'TILTING'
    				| 'WALKING'
    				| 'RUNNING'
    				| 'AEROBICS'
    				| 'BADMINTON'
    				| 'BASEBALL'
    				| 'BASKETBALL'
    				| 'BIATHLON'
    				| 'HANDBIKING'
    				| 'MOUNTAIN_BIKING'
    				| 'ROAD_BIKING'
    				| 'SPINNING'
    				| 'STATIONARY_BIKING'
    				| 'UTILITY_BIKING'
    				| 'BOXING'
    				| 'CALISTHENICS'
    				| 'CIRCUIT_TRAINING'
    				| 'CRICKET'
    				| 'DANCING'
    				| 'ELLIPTICAL'
    				| 'FENCING'
    				| 'AMERICAN_FOOTBALL'
    				| 'AUSTRALIAN_FOOTBALL'
    				| 'ENGLISH_FOOTBALL'
    				| 'FRISBEE'
    				| 'GARDENING'
    				| 'GOLF'
    				| 'GYMNASTICS'
    				| 'HANDBALL'
    				| 'HIKING'
    				| 'HOCKEY'
    				| 'HORSEBACK_RIDING'
    				| 'HOUSEWORK'
    				| 'JUMPING_ROPE'
    				| 'KAYAKING'
    				| 'KETTLEBELL_TRAINING'
    				| 'KICKBOXING'
    				| 'KITESURFING'
    				| 'MARTIAL_ARTS'
    				| 'MEDITATION'
    				| 'MIXED_MARTIAL_ARTS'
    				| 'P90X_EXERCISES'
    				| 'PARAGLIDING'
    				| 'PILATES'
    				| 'POLO'
    				| 'RACQUETBALL'
    				| 'ROCK_CLIMBING'
    				| 'ROWING'
    				| 'ROWING_MACHINE'
    				| 'RUGBY'
    				| 'JOGGING'
    				| 'RUNNING_ON_SAND'
    				| 'TREADMILL_RUNNING'
    				| 'SAILING'
    				| 'SCUBA_DIVING'
    				| 'SKATEBOARDING'
    				| 'SKATING'
    				| 'CROSS_SKATING'
    				| 'INDOOR_ROLLERBLADING'
    				| 'SKIING'
    				| 'BACK_COUNTRY_SKIING'
    				| 'CROSS_COUNTRY_SKIING'
    				| 'DOWNHILL_SKIING'
    				| 'KITE_SKIING'
    				| 'ROLLER_SKIING'
    				| 'SLEDDING'
    				| 'SNOWBOARDING'
    				| 'SNOWMOBILE'
    				| 'SNOWSHOEING'
    				| 'SQUASH'
    				| 'STAIR_CLIMBING'
    				| 'STAIR_CLIMBING_MACHINE'
    				| 'STAND_UP_PADDLEBOARDING'
    				| 'STRENGTH_TRAINING'
    				| 'SURFING'
    				| 'SWIMMING'
    				| 'SWIMMING_SWIMMING_POOL'
    				| 'SWIMMING_OPEN_WATER'
    				| 'TABLE_TENNIS'
    				| 'TEAM_SPORTS'
    				| 'TENNIS'
    				| 'TREADMILL'
    				| 'VOLLEYBALL'
    				| 'VOLLEYBALL_BEACH'
    				| 'VOLLEYBALL_INDOOR'
    				| 'WAKEBOARDING'
    				| 'WALKING_FITNESS'
    				| 'NORDIC_WALKING'
    				| 'WALKING_TREADMILL'
    				| 'WATERPOLO'
    				| 'WEIGHTLIFTING'
    				| 'WHEELCHAIR'
    				| 'WINDSURFING'
    				| 'YOGA'
    				| 'ZUMBA'
    				| 'DIVING'
    				| 'ERGOMETER'
    				| 'ICE_SKATING'
    				| 'INDOOR_SKATING'
    				| 'CURLING'
    				| 'OTHER'
    				| 'CROSSFIT'
    				| 'HIIT'
    				| 'INTERVAL_TRAINING'
    				| 'WALKING_STROLLER'
    				| 'ELEVATOR'
    				| 'ESCALATOR'
    				| 'ARCHERY'
    				| 'SOFTBALL'
    				| 'GUIDED_BREATHING'
    				| 'CARDIO_TRAINING'
    				| 'LACROSSE'
    				| 'STRETCHING'
    				| 'TRIATHLON'
    				| 'INLINE_SKATING'
    				| 'SKY_DIVING'
    				| 'PADDLING'
    				| 'MOUNTAINEERING'
    				| 'FISHING'
    				| 'WATER_SKIING'
    				| 'INDOOR_RUNNING'
    			id?: string | null
    			/**
    			 * Estimated workout duration
    			 */
    			estimated_duration_seconds?: number | null
    			/**
    			 * Estimated pace for the workout
    			 */
    			estimated_pace_minutes_per_kilometer?: number | null
    			/**
    			 * Name of the original source of the workout plan
    			 */
    			provider?: string
    			/**
    			 * Estimated training stress score for the workout (normalized power-based metric)
    			 */
    			estimated_tscore?: number | null
    			/**
    			 * Description of the workout
    			 */
    			description?: string | null
    			/**
    			 * Name of the workout plan
    			 */
    			name?: string | null
    			/**
    			 * Estimated distance for the workout
    			 */
    			estimated_distance_meters?: number | null
    			/**
    			 * Estimated Intensity Factor for the workout
    			 */
    			estimated_if?: number | null
    			/**
    			 * Pool length of the pool used for the workout - only relevant for swimming activity types
    			 */
    			pool_length_meters?: number | null
    			[k: string]: unknown
    		}
    		[k: string]: unknown
    	}[]
    	[k: string]: unknown
    }
    

    Submitted by hugo697 235 days ago