-
Perform a search for activities matching the given
parameters.Declaration
Swift
@discardableResult public func search(_ parameters: SearchInput<UserWorkoutFileSearch>, offset: Int, count: Int, completion: @escaping Zone5.ResultHandler<SearchResult<UserWorkoutResult>>) -> PendingRequest?Parameters
parametersThe criteria to use when performing the search.
offsetThe pagination offset for the retrieved set of
UserWorkoutResultvalues.countThe number of
UserWorkoutResultvalues to retrieve.completionFunction called with the
UserWorkoutResultresults matching the given criteria, or the error if one occurred. -
Get the next paginated set from the previous search.
Declaration
Swift
@discardableResult public func next(offset: Int, count: Int, completion: @escaping Zone5.ResultHandler<SearchResult<UserWorkoutResult>>) -> PendingRequest?Parameters
offsetThe pagination offset for the retrieved set of
UserWorkoutResultvalues.countThe number of
UserWorkoutResultvalues to retrieve.completionFunction called with the
UserWorkoutResultresults matching the given criteria, or the error if one occurred.
-
Undocumented
Declaration
Swift
@discardableResult public func upload(_ fileURL: URL, context: DataFileUploadContext, completion: @escaping Zone5.ResultHandler<DataFileUploadIndex>) -> PendingRequest? -
Request the processing status of an uploaded file with the given
indexID.Declaration
Swift
@discardableResult public func uploadStatus(of indexID: Int, completion: @escaping Zone5.ResultHandler<DataFileUploadIndex>) -> PendingRequest?Parameters
indexIDThe
idfrom the result of a previous upload’sDataFileUploadIndexresponse.completionFunction called with the upload status for the requested file, or the error if one occurred.
-
Download the originally uploaded file.
Note
The cached file is deleted upon return of the completion handler, and so the file should be copied to an alternate location before performing any asynchronous tasks, or before returning from the closure.Declaration
Swift
@discardableResult public func downloadOriginal(_ fileID: Int, completion: @escaping Zone5.ResultHandler<URL>) -> PendingRequest?Parameters
fileIDThe identifier for the file to be downloaded.
completionFunction called with the location of the downloaded file on disk, or the error if one occurred.
-
Download a normalized FIT file which contains typed numeric data channels. Use this for time series graphs or raw channel analysis.
Note
The cached file is deleted upon return of the completion handler, and so the file should be copied to an alternate location before performing any asynchronous tasks, or before returning from the closure.Declaration
Swift
@discardableResult public func downloadRaw(_ fileID: Int, completion: @escaping Zone5.ResultHandler<URL>) -> PendingRequest?Parameters
fileIDThe identifier for the file to be downloaded.
completionFunction called with the location of the downloaded file on disk, or the error if one occurred.
-
Download the normalized CSV file.
Note
The cached file is deleted upon return of the completion handler, and so the file should be copied to an alternate location before performing any asynchronous tasks, or before returning from the closure.Declaration
Swift
@discardableResult public func downloadCSV(_ fileID: Int, completion: @escaping Zone5.ResultHandler<URL>) -> PendingRequest?Parameters
fileIDThe identifier for the file to be downloaded.
completionFunction called with the location of the downloaded file on disk, or the error if one occurred.
-
Download a PNG image with the ride plotted on a map.
Note
The cached file is deleted upon return of the completion handler, and so the file should be copied to an alternate location before performing any asynchronous tasks, or before returning from the closure.Declaration
Swift
@discardableResult public func downloadMap(_ fileID: Int, completion: @escaping Zone5.ResultHandler<URL>) -> PendingRequest?Parameters
fileIDThe identifier for the file to be downloaded.
completionFunction called with the location of the downloaded file on disk, or the error if one occurred.
-
Delete a file, event or workout using its
id.Declaration
Swift
@discardableResult public func delete(type: ActivityResultType, id: Int, completion: @escaping Zone5.ResultHandler<Bool>) -> PendingRequest?Parameters
typeThe result type of the activity to be deleted.
idThe identifier for the activity to be deleted.
completionFunction called with the result of the deletion, or the error if one occurred.
-
Undocumented
Declaration
Swift
@discardableResult public func timeInZones(type: ActivityResultType, id: Int, zoneType: IntensityZoneType, completion: @escaping Zone5.ResultHandler<MappedResult<UserWorkoutResult>>) -> PendingRequest?
-
Get the peak power curve for this activity, and include a reference series.
Declaration
Swift
@discardableResult public func peakPowerCurve(type: ActivityResultType, id: Int, referencePeriod: RelativePeriod? = nil, completion: @escaping Zone5.ResultHandler<MappedResult<UserWorkoutResult>>) -> PendingRequest?Parameters
typeThe result type of the activity in question.
idThe identifier for the activity in question.
referencePeriodThe optional reference period to use for the search. Defaults to
nil.completionFunction called with the
UserWorkoutResultvalues returned by the server, or the error if one occurred. -
Get the peak heart rate curve for this activity, and include a reference series.
Declaration
Swift
@discardableResult public func peakHeartRateCurve(type: ActivityResultType, id: Int, referencePeriod: RelativePeriod? = nil, completion: @escaping Zone5.ResultHandler<MappedResult<UserWorkoutResult>>) -> PendingRequest?Parameters
typeThe result type of the activity in question.
idThe identifier for the activity in question.
referencePeriodThe optional reference period to use for the search. Defaults to
nil.completionFunction called with the
UserWorkoutResultvalues returned by the server, or the error if one occurred. -
Get the peak w/kg curve for this activity, and include a reference series.
Declaration
Swift
@discardableResult public func peakWKgCurve(type: ActivityResultType, id: Int, referencePeriod: RelativePeriod? = nil, completion: @escaping Zone5.ResultHandler<MappedResult<UserWorkoutResult>>) -> PendingRequest?Parameters
typeThe result type of the activity in question.
idThe identifier for the activity in question.
referencePeriodThe optional reference period to use for the search. Defaults to
nil.completionFunction called with the
UserWorkoutResultvalues returned by the server, or the error if one occurred. -
Get the peak pace curve for this activity, and include a reference series.
Declaration
Swift
@discardableResult public func peakPaceCurve(type: ActivityResultType, id: Int, referencePeriod: RelativePeriod? = nil, completion: @escaping Zone5.ResultHandler<MappedResult<UserWorkoutResult>>) -> PendingRequest?Parameters
typeThe result type of the activity in question.
idThe identifier for the activity in question.
referencePeriodThe optional reference period to use for the search. Defaults to
nil.completionFunction called with the
UserWorkoutResultvalues returned by the server, or the error if one occurred. -
Get the peak leg spring stiffness curve for this activity, and include a reference series.
Declaration
Swift
@discardableResult public func peakLSSCurve(type: ActivityResultType, id: Int, referencePeriod: RelativePeriod? = nil, completion: @escaping Zone5.ResultHandler<MappedResult<UserWorkoutResult>>) -> PendingRequest?Parameters
typeThe result type of the activity in question.
idThe identifier for the activity in question.
referencePeriodThe optional reference period to use for the search. Defaults to
nil.completionFunction called with the
UserWorkoutResultvalues returned by the server, or the error if one occurred. -
Get the peak leg spring stiffness/kg for this activity, and include a reference series.
Declaration
Swift
@discardableResult public func peakLSSKgCurve(type: ActivityResultType, id: Int, referencePeriod: RelativePeriod? = nil, completion: @escaping Zone5.ResultHandler<MappedResult<UserWorkoutResult>>) -> PendingRequest?Parameters
typeThe result type of the activity in question.
idThe identifier for the activity in question.
referencePeriodThe optional reference period to use for the search. Defaults to
nil.completionFunction called with the
UserWorkoutResultvalues returned by the server, or the error if one occurred.
-
Set the Specialized bike for a completed activity, using the given
bikeID.Warning
Specialized feature set only.Declaration
Swift
@discardableResult public func setBike(type: ActivityResultType, id: Int, bikeID: String, completion: @escaping Zone5.ResultHandler<Bool>) -> PendingRequest?Parameters
typeThe result type of the activity to add the bike to.
idThe identifier for the activity to add the bike to.
bikeIDThe identifier for the bike to be added.
completionFunction called with the result of the bike addition, or the error if one occurred.
-
Remove the Specialized bike from a completed activity.
Warning
Specialized feature set only.Declaration
Swift
@discardableResult public func removeBike(type: ActivityResultType, id: Int, completion: @escaping Zone5.ResultHandler<Bool>) -> PendingRequest?Parameters
typeThe result type of the activity to remove the bike from.
idThe identifier for the activity to remove the bike from.
completionFunction called with the result of the bike removal, or the error if one occurred.
-
Toggle ebike flag for a completed activity
Warning
Specialized feature set only.Declaration
Swift
@discardableResult public func setIsEbike(type: ActivityResultType, id: Int, isEbike: Bool, completion: @escaping Zone5.ResultHandler<Bool>) -> PendingRequest?Parameters
typeThe result type of the activity to remove the bike from.
idThe identifier for the activity to remove the bike from.
isEbiketrue to set this activity as an E-Bike activity, false to set it as not as E-Bike activity.
completionFunction called with the result of the call
View on GitHub
ActivitiesView Class Reference