-
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
parameters
The criteria to use when performing the search.
offset
The pagination offset for the retrieved set of
UserWorkoutResult
values.count
The number of
UserWorkoutResult
values to retrieve.completion
Function called with the
UserWorkoutResult
results 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
offset
The pagination offset for the retrieved set of
UserWorkoutResult
values.count
The number of
UserWorkoutResult
values to retrieve.completion
Function called with the
UserWorkoutResult
results 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
indexID
The
id
from the result of a previous upload’sDataFileUploadIndex
response.completion
Function 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
fileID
The identifier for the file to be downloaded.
completion
Function 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
fileID
The identifier for the file to be downloaded.
completion
Function 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
fileID
The identifier for the file to be downloaded.
completion
Function 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
fileID
The identifier for the file to be downloaded.
completion
Function 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
type
The result type of the activity to be deleted.
id
The identifier for the activity to be deleted.
completion
Function 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
type
The result type of the activity in question.
id
The identifier for the activity in question.
referencePeriod
The optional reference period to use for the search. Defaults to
nil
.completion
Function called with the
UserWorkoutResult
values 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
type
The result type of the activity in question.
id
The identifier for the activity in question.
referencePeriod
The optional reference period to use for the search. Defaults to
nil
.completion
Function called with the
UserWorkoutResult
values 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
type
The result type of the activity in question.
id
The identifier for the activity in question.
referencePeriod
The optional reference period to use for the search. Defaults to
nil
.completion
Function called with the
UserWorkoutResult
values 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
type
The result type of the activity in question.
id
The identifier for the activity in question.
referencePeriod
The optional reference period to use for the search. Defaults to
nil
.completion
Function called with the
UserWorkoutResult
values 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
type
The result type of the activity in question.
id
The identifier for the activity in question.
referencePeriod
The optional reference period to use for the search. Defaults to
nil
.completion
Function called with the
UserWorkoutResult
values 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
type
The result type of the activity in question.
id
The identifier for the activity in question.
referencePeriod
The optional reference period to use for the search. Defaults to
nil
.completion
Function called with the
UserWorkoutResult
values 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
type
The result type of the activity to add the bike to.
id
The identifier for the activity to add the bike to.
bikeID
The identifier for the bike to be added.
completion
Function 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
type
The result type of the activity to remove the bike from.
id
The identifier for the activity to remove the bike from.
completion
Function 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
type
The result type of the activity to remove the bike from.
id
The identifier for the activity to remove the bike from.
isEbike
true to set this activity as an E-Bike activity, false to set it as not as E-Bike activity.
completion
Function called with the result of the call