Interface ISegmentsApi
- Namespace
- Tudormobile.Strava.Api
- Assembly
- Tudormobile.Strava.dll
Strava V3 Segments API Interface.
public interface ISegmentsApi : ISegmentEffortsApi
- Inherited Members
Methods
ExploreSegmentsAsync(Bounds, string?, int?, int?, CancellationToken)
Returns a list of the top 10 segments matching a specified query.
Task<ApiResult<SegmentList>> ExploreSegmentsAsync(Bounds bounds, string? activityType = null, int? minimumCategory = null, int? maximumCategory = null, CancellationToken cancellationToken = default)
Parameters
boundsBoundsThe geographical bounds within which to search for segments.
activityTypestringThe type of activity (e.g., "running", "riding") to filter segments.
minimumCategoryint?The minimum climb category to filter segments (optional).
maximumCategoryint?The maximum climb category to filter segments (optional).
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ApiResult<SegmentList>>
An instance of ApiResult<T> where T is SegmentList.
GetSegmentAsync(long, CancellationToken)
Gets a detailed segment by its unique identifier.
Task<ApiResult<DetailedSegment>> GetSegmentAsync(long id, CancellationToken cancellationToken = default)
Parameters
idlongThe unique identifier of the segment.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<ApiResult<DetailedSegment>>
An ApiResult<T> containing the DetailedSegment if successful; otherwise, an error.
ListStarredSegmentsAsync(int?, int?, CancellationToken)
Returns a list of the authenticated athlete's starred segments.
Task<ApiResult<List<Segment>>> ListStarredSegmentsAsync(int? page = null, int? perPage = null, CancellationToken cancellationToken = default)
Parameters
pageint?Page number (optional).
perPageint?Number of items per page (optional).
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
StarSegmentAsync(long, bool, CancellationToken)
Stars or unstars the specified segment asynchronously for the authenticated user.
Task<ApiResult<Segment>> StarSegmentAsync(long id, bool removeStar = false, CancellationToken cancellationToken = default)
Parameters
idlongThe unique identifier of the segment to star or unstar.
removeStarboolIf true, removes the star from the segment; otherwise, adds a star. The default is false.
cancellationTokenCancellationTokenA cancellation token that can be used to cancel the asynchronous operation.
Returns
- Task<ApiResult<Segment>>
A task that represents the asynchronous operation. The task result contains an ApiResult<T> with the updated segment details.
UnstarSegmentAsync(long, CancellationToken)
Removes the authenticated athlete's star from the specified segment asynchronously.
Task<ApiResult<Segment>> UnstarSegmentAsync(long id, CancellationToken cancellationToken = default)
Parameters
idlongThe identifier of the segment to unstar.
cancellationTokenCancellationTokenA cancellation token that can be used to cancel the asynchronous operation.
Returns
- Task<ApiResult<Segment>>
A task that represents the asynchronous operation. The task result contains an ApiResult<T> with details of the updated segment.