ActivitiesView

public class ActivitiesView : APIView

Undocumented

Browsing activities

Uploading files

Downloading files

  • 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.

Deleting

  • 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.

Time in Zones

Instance Peak Curves

Specialized Feature Set

  • 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