All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javastrava.api.v3.service.ClubService Maven / Gradle / Ivy

There is a newer version: 1.0.3.6
Show newest version
package javastrava.api.v3.service;

import java.util.List;
import java.util.concurrent.CompletableFuture;

import javastrava.api.v3.model.StravaActivity;
import javastrava.api.v3.model.StravaAthlete;
import javastrava.api.v3.model.StravaClub;
import javastrava.api.v3.model.StravaClubAnnouncement;
import javastrava.api.v3.model.StravaClubEvent;
import javastrava.api.v3.model.StravaClubMembershipResponse;
import javastrava.api.v3.model.reference.StravaResourceState;
import javastrava.util.Paging;

/**
 * 

* {@link StravaClub} related services *

* *

* {@link StravaClub Clubs} represent groups of {@link StravaAthlete athletes} on Strava. They can be public or private. *

* *

* Only members of private clubs can access their details. *

* *

* The object is returned in summary or detailed {@link StravaResourceState representations}. *

* * @author Dan Shannon * */ public interface ClubService extends StravaService { /** *

* Retrieve details about a specific {@link StravaClub club}. The club must be public or the current {@link StravaAthlete 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 *

* * @see http://strava.github.io/api/v3/clubs/#get-details * * @param clubId * The id of the {@link StravaClub} to be retrieved * @return Returns a detailed club representation. */ public StravaClub getClub(final Integer clubId); /** *

* Retrieve details about a specific {@link StravaClub club}. The club must be public or the current {@link StravaAthlete 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 *

* * @see http://strava.github.io/api/v3/clubs/#get-details * * @param clubId * The id of the {@link StravaClub} to be retrieved * @return Returns a detailed club representation. */ public CompletableFuture getClubAsync(final Integer clubId); /** *

* Join a club on behalf of the authenticated user. An access token with write permissions is required. *

* * @param clubId * ID of the {@link StravaClub} to join * @return Response detailing whether request was successful and whether the member is active */ public StravaClubMembershipResponse joinClub(final Integer clubId); /** *

* Join a club on behalf of the authenticated user. An access token with write permissions is required. *

* * @param clubId * ID of the {@link StravaClub} to join * @return Response detailing whether request was successful and whether the member is active */ public CompletableFuture joinClubAsync(final Integer clubId); /** *

* Leave a club on behalf of the authenticated user. An access token with write permissions is required. *

* * @param clubId * ID of the club to join * @return Response detailing whether request was successful and whether the member is active */ public StravaClubMembershipResponse leaveClub(final Integer clubId); /** *

* Leave a club on behalf of the authenticated user. An access token with write permissions is required. *

* * @param clubId * ID of the club to join * @return Response detailing whether request was successful and whether the member is active */ public CompletableFuture leaveClubAsync(final Integer clubId); /** *

* Convenience 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 *

* * @see http://strava.github.io/api/v3/clubs/#get-members * * @param clubId * The id of the {@link StravaClub} whose member {@link StravaAthlete athletes} should be returned * @return Returns an array of {@link StravaAthlete athlete} summary {@link StravaResourceState representations}. */ public List listAllClubMembers(final Integer clubId); /** *

* Convenience 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 *

* * @see http://strava.github.io/api/v3/clubs/#get-members * * @param clubId * The id of the {@link StravaClub} whose member {@link StravaAthlete athletes} should be returned * @return Returns an array of {@link StravaAthlete athlete} summary {@link StravaResourceState representations}. */ public CompletableFuture> listAllClubMembersAsync(final Integer clubId); /** *

* Retrieve ALL the recent {@link StravaActivity activities} performed by member {@link StravaAthlete athletes} of a specific {@link StravaClub 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. *

* * @see http://strava.github.io/api/v3/clubs/#get-activities * * @param clubId * The id of the {@link StravaClub} for which recent {@link StravaActivity activities} are to be returned. * @return Returns an array of {@link StravaActivity activity} summary {@link StravaResourceState representations}. */ public List listAllRecentClubActivities(final Integer clubId); /** *

* Retrieve ALL the recent {@link StravaActivity activities} performed by member {@link StravaAthlete athletes} of a specific {@link StravaClub 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. *

* * @see http://strava.github.io/api/v3/clubs/#get-activities * * @param clubId * The id of the {@link StravaClub} for which recent {@link StravaActivity activities} are to be returned. * @return Returns an array of {@link StravaActivity activity} summary {@link StravaResourceState representations}. */ public CompletableFuture> listAllRecentClubActivitiesAsync(final Integer clubId); /** *

* Fetch an array of {@link StravaClub clubs} that the currently authenticated {@link StravaAthlete 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 *

* * @see http://strava.github.io/api/v3/clubs/#get-athletes * * @return Returns a list of {@link StravaClub club} {@link StravaResourceState summary} representations. */ public List listAuthenticatedAthleteClubs(); /** *

* Fetch an array of {@link StravaClub clubs} that the currently authenticated {@link StravaAthlete 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 *

* * @see http://strava.github.io/api/v3/clubs/#get-athletes * * @return Returns a list of {@link StravaClub club} {@link StravaResourceState summary} representations. */ public CompletableFuture> listAuthenticatedAthleteClubsAsync(); public List listClubAdmins(final Integer clubId); public CompletableFuture> listClubAdminsAsync(final Integer clubId); public List listClubAdmins(final Integer clubId, final Paging paging); public CompletableFuture> listClubAdminsAsync(final Integer clubId, final Paging paging); public List listAllClubAdmins(final Integer clubId); public CompletableFuture> listAllClubAdminsAsync(final Integer clubId); /** *

Announcements are posts sent by Club Admins or Owners to the members of a club.

* *

Only members of private clubs can access their announcements.

* *

The objects are returned in summary representation.

* *

Returns null if the club with the given id does not exist.

* *

Returns an empty list if the club is private and the authorised athlete is not a member of the club

* *

Pagination is not supported

* * @see http://strava.github.io/api/v3/clubs/#get-announcements * * @param clubId The id of the {@link StravaClub} for which announcements should be returned. * @return Returns a list of {@link StravaClubAnnouncement announcements} */ public List listClubAnnouncements(final Integer clubId); /** *

Announcements are posts sent by Club Admins or Owners to the members of a club.

* *

Only members of private clubs can access their announcements.

* *

The objects are returned in summary representation.

* *

Returns null if the club with the given id does not exist.

* *

Returns an empty list if the club is private and the authorised athlete is not a member of the club

* *

Pagination is not supported

* * @see http://strava.github.io/api/v3/clubs/#get-announcements * * @param clubId The id of the {@link StravaClub} for which announcements should be returned. * @return Returns a list of {@link StravaClubAnnouncement announcements} */ public CompletableFuture> listClubAnnouncementsAsync(final Integer clubId); /** *

* Group Events are optionally recurring events for club members. *

*

* Only club members can access private club events. *

*

* The objects are returned in summary representation. *

* *

* Pagination is NOT supported *

* * @see http://strava.github.io/api/partner/v3/clubs/#get-group-events * @param clubId Club identifier * @return List of all club events */ public List listClubGroupEvents(final Integer clubId); /** *

* Group Events are optionally recurring events for club members. *

*

* Only club members can access private club events. *

*

* The objects are returned in summary representation. *

* *

* Pagination is NOT supported *

* * @see http://strava.github.io/api/partner/v3/clubs/#get-group-events * @param clubId Club identifier * @return List of all club events (to retrieve call {@link CompletableFuture#get()}) */ public CompletableFuture> listClubGroupEventsAsync(final Integer clubId); /** *

* Retrieve summary information about member {@link StravaAthlete athletes} of a specific {@link StravaClub 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 *

* * @see http://strava.github.io/api/v3/clubs/#get-members * * @param clubId * The id of the {@link StravaClub} whose member {@link StravaAthlete athletes} should be returned * @return Returns an array of {@link StravaAthlete athlete} summary {@link StravaResourceState representations}. */ public List listClubMembers(final Integer clubId); /** *

* Retrieve summary information about member {@link StravaAthlete athletes} of a specific {@link StravaClub 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 *

* * @see http://strava.github.io/api/v3/clubs/#get-members * * @param clubId * The id of the {@link StravaClub} whose member {@link StravaAthlete athletes} should be returned * @param pagingInstruction * (Optional) The page to be returned * @return Returns an array of {@link StravaAthlete athlete} summary {@link StravaResourceState representations}. */ public List listClubMembers(final Integer clubId, final Paging pagingInstruction); /** *

* Retrieve summary information about member {@link StravaAthlete athletes} of a specific {@link StravaClub 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 *

* * @see http://strava.github.io/api/v3/clubs/#get-members * * @param clubId * The id of the {@link StravaClub} whose member {@link StravaAthlete athletes} should be returned * @return Returns an array of {@link StravaAthlete athlete} summary {@link StravaResourceState representations}. */ public CompletableFuture> listClubMembersAsync(final Integer clubId); /** *

* Retrieve summary information about member {@link StravaAthlete athletes} of a specific {@link StravaClub 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 *

* * @see http://strava.github.io/api/v3/clubs/#get-members * * @param clubId * The id of the {@link StravaClub} whose member {@link StravaAthlete athletes} should be returned * @param pagingInstruction * (Optional) The page to be returned * @return Returns an array of {@link StravaAthlete athlete} summary {@link StravaResourceState representations}. */ public CompletableFuture> listClubMembersAsync(final Integer clubId, final Paging pagingInstruction); /** *

* Retrieve the recent {@link StravaActivity activities} performed by member {@link StravaAthlete athletes} of a specific {@link StravaClub 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 *

* * @see http://strava.github.io/api/v3/clubs/#get-activities * * @param clubId * The id of the {@link StravaClub} for which recent {@link StravaActivity activities} are to be returned. * @return Returns an array of {@link StravaActivity activity} summary {@link StravaResourceState representations}. */ public List listRecentClubActivities(final Integer clubId); /** *

* Retrieve the recent {@link StravaActivity activities} performed by member {@link StravaAthlete athletes} of a specific {@link StravaClub 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. *

* * @see http://strava.github.io/api/v3/clubs/#get-activities * * @param clubId * The id of the {@link StravaClub} for which recent {@link StravaActivity activities} are to be returned. * @param pagingInstruction * (Optional) The page to be returned * @return Returns an array of {@link StravaActivity activity} summary {@link StravaResourceState representations}. */ public List listRecentClubActivities(final Integer clubId, final Paging pagingInstruction); /** *

* Retrieve the recent {@link StravaActivity activities} performed by member {@link StravaAthlete athletes} of a specific {@link StravaClub 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 *

* * @see http://strava.github.io/api/v3/clubs/#get-activities * * @param clubId * The id of the {@link StravaClub} for which recent {@link StravaActivity activities} are to be returned. * @return Returns an array of {@link StravaActivity activity} summary {@link StravaResourceState representations}. */ public CompletableFuture> listRecentClubActivitiesAsync(final Integer clubId); /** *

* Retrieve the recent {@link StravaActivity activities} performed by member {@link StravaAthlete athletes} of a specific {@link StravaClub 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. *

* * @see http://strava.github.io/api/v3/clubs/#get-activities * * @param clubId * The id of the {@link StravaClub} for which recent {@link StravaActivity activities} are to be returned. * @param pagingInstruction * (Optional) The page to be returned * @return Returns an array of {@link StravaActivity activity} summary {@link StravaResourceState representations}. */ public CompletableFuture> listRecentClubActivitiesAsync(final Integer clubId, final Paging pagingInstruction); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy