public class ClubServiceImpl extends StravaServiceImpl<ClubAPI> implements ClubService
Implementation of ClubService
requestRate, requestRateDaily, restService| Modifier and Type | Method and Description |
|---|---|
StravaClub |
getClub(Integer id)
Retrieve details about a specific
club. |
static ClubService |
instance(Token token)
Returns an instance of
club services |
StravaClubMembershipResponse |
joinClub(Integer id)
Join a club on behalf of the authenticated user.
|
StravaClubMembershipResponse |
leaveClub(Integer id)
Leave a club on behalf of the authenticated user.
|
List<StravaAthlete> |
listAllClubMembers(Integer clubId)
Convenience method for returning ALL of the members of a club
|
List<StravaActivity> |
listAllRecentClubActivities(Integer clubId)
|
List<StravaClub> |
listAuthenticatedAthleteClubs()
|
List<StravaAthlete> |
listClubMembers(Integer id)
|
List<StravaAthlete> |
listClubMembers(Integer id,
Paging pagingInstruction)
|
List<StravaActivity> |
listRecentClubActivities(Integer id)
|
List<StravaActivity> |
listRecentClubActivities(Integer id,
Paging pagingInstruction)
|
accessTokenIsValid, getToken, requestRateDailyPercentage, requestRatePercentagepublic static ClubService instance(Token token)
Returns an instance of club services
Instances are cached so that if 2 requests are made for the same token, the same instance is returned
token - The Strava access token to be used in requests to the Strava APIUnauthorizedException - If the token used to create the service is invalidpublic StravaClub getClub(Integer id)
ClubService
Retrieve details about a specific club. The club must be public or the current athlete must be a member.
Returns null if club with the given id does not exist
Returns an empty club (with only the id set) if the club is private and the authenticated athlete is not a member
URL GET https://www.strava.com/api/v3/clubs/:id
getClub in interface ClubServiceid - The id of the StravaClub to be retrievedClubService.getClub(java.lang.Integer)public List<StravaClub> listAuthenticatedAthleteClubs()
ClubService
Fetch an array of clubs that the currently authenticated athlete is a member of.
Pagination is not supported. Returns all clubs of which the athlete is a member.
URL GET https://www.strava.com/api/v3/athlete/clubs
listAuthenticatedAthleteClubs in interface ClubServiceclub summary representations.ClubService.listAuthenticatedAthleteClubs()public List<StravaAthlete> listClubMembers(Integer id, Paging pagingInstruction)
ClubService
Retrieve summary information about member athletes of a specific club.
Pagination is supported.
Returns null if club with the given id does not exist
Returns an empty list if the club is private
URL GET https://www.strava.com/api/v3/clubs/:id/members
listClubMembers in interface ClubServiceid - The id of the StravaClub whose member athletes should be returnedpagingInstruction - (Optional) The page to be returnedathlete summary representations.ClubService.listClubMembers(Integer, Paging)public List<StravaActivity> listRecentClubActivities(Integer id, Paging pagingInstruction)
ClubService
Retrieve the recent activities performed by member athletes of a specific club.
The authenticated athlete must be a member of the club.
Returns null if club with the given id does not exist
Returns an empty list if the authorised athlete is not a member of the club
Pagination is supported. However, the results are limited to the last 200 total activities by club members.
listRecentClubActivities in interface ClubServiceid - The id of the StravaClub for which recent activities are to be returned.pagingInstruction - (Optional) The page to be returnedactivity summary representations.ClubService.listRecentClubActivities(Integer, Paging)public StravaClubMembershipResponse joinClub(Integer id)
ClubServiceJoin a club on behalf of the authenticated user. An access token with write permissions is required.
joinClub in interface ClubServiceid - ID of the StravaClub to joinClubService.joinClub(java.lang.Integer)public StravaClubMembershipResponse leaveClub(Integer id)
ClubServiceLeave a club on behalf of the authenticated user. An access token with write permissions is required.
leaveClub in interface ClubServiceid - ID of the club to joinClubService.leaveClub(java.lang.Integer)public List<StravaAthlete> listClubMembers(Integer id)
ClubService
Retrieve summary information about member athletes of a specific club.
Pagination is not supported. Returns only the first page of members.
Returns null if club with the given id does not exist
Returns an empty list if the club is private
URL GET https://www.strava.com/api/v3/clubs/:id/members
listClubMembers in interface ClubServiceid - The id of the StravaClub whose member athletes should be returnedathlete summary representations.ClubService.listClubMembers(java.lang.Integer)public List<StravaActivity> listRecentClubActivities(Integer id)
ClubService
Retrieve the recent activities performed by member athletes of a specific club.
The authenticated athlete must be a member of the club.
Pagination is NOT supported. Returns only the first page of activities.
Returns null if club with the given id does not exist
Returns an empty list if the authorised athlete is not a member of the club
listRecentClubActivities in interface ClubServiceid - The id of the StravaClub for which recent activities are to be returned.activity summary representations.ClubService.listRecentClubActivities(java.lang.Integer)public List<StravaAthlete> listAllClubMembers(Integer clubId)
ClubServiceConvenience method for returning ALL of the members of a club
Returns ALL the members, regardless of how many there are
Pagination is NOT supported.
USE WITH CAUTION - CLUBS WITH MANY MEMBERS WILL REQUIRE MANY CALLS TO THE STRAVA API
Returns null if club with the given id does not exist
Returns an empty list if the club is private
URL GET https://www.strava.com/api/v3/clubs/:id/members
listAllClubMembers in interface ClubServiceclubId - The id of the StravaClub whose member athletes should be returnedathlete summary representations.ClubService.listAllClubMembers(java.lang.Integer)public List<StravaActivity> listAllRecentClubActivities(Integer clubId)
ClubService
Retrieve ALL the recent activities performed by member athletes of a specific club.
The authenticated athlete must be a member of the club.
Returns null if club with the given id does not exist
Returns an empty list if the authorised athlete is not a member of the club
Pagination is supported. However, the results are limited to the last 200 total activities by club members.
listAllRecentClubActivities in interface ClubServiceclubId - The id of the StravaClub for which recent activities are to be returned.activity summary representations.ClubService.listAllRecentClubActivities(java.lang.Integer)Copyright © 2015 Dan Shannon. All rights reserved.