-- | module Strive.Actions.Friends ( getCurrentFriends , getFriends , getCurrentFollowers , getFollowers , getCommonFriends ) where import Network.HTTP.Types (toQuery) import Strive.Client (Client) import Strive.Internal.HTTP (get) import Strive.Options (GetCommonFriendsOptions, GetCurrentFollowersOptions, GetCurrentFriendsOptions, GetFollowersOptions, GetFriendsOptions) import Strive.Types (AthleteSummary) -- | getCurrentFriends :: Client -> GetCurrentFriendsOptions -> IO (Either String [AthleteSummary]) getCurrentFriends client options = get client resource query where resource = "api/v3/athlete/friends" query = toQuery options -- | getFriends :: Client -> Integer -> GetFriendsOptions -> IO (Either String [AthleteSummary]) getFriends client athleteId options = get client resource query where resource = "api/v3/athletes/" ++ show athleteId ++ "/friends" query = toQuery options -- | getCurrentFollowers :: Client -> GetCurrentFollowersOptions -> IO (Either String [AthleteSummary]) getCurrentFollowers client options = get client resource query where resource = "api/v3/athlete/followers" query = toQuery options -- | getFollowers :: Client -> Integer -> GetFollowersOptions -> IO (Either String [AthleteSummary]) getFollowers client athleteId options = get client resource query where resource = "api/v3/athletes/" ++ show athleteId ++ "/followers" query = toQuery options -- | getCommonFriends :: Client -> Integer -> GetCommonFriendsOptions -> IO (Either String [AthleteSummary]) getCommonFriends client athleteId options = get client resource query where resource = "api/v3/athletes/" ++ show athleteId ++ "/both-following" query = toQuery options