Start generating parse methods (#4)
Co-authored-by: Smaug123 <patrick+github@patrickstevens.co.uk> Reviewed-on: #4
This commit is contained in:
39
PureGym/Client.fs
Normal file
39
PureGym/Client.fs
Normal file
@@ -0,0 +1,39 @@
|
||||
namespace PureGym
|
||||
|
||||
open System
|
||||
open System.Net.Http
|
||||
open System.Threading
|
||||
open System.Threading.Tasks
|
||||
open RestEase
|
||||
|
||||
/// The PureGym REST API. You probably want to instantiate one of these with `Api.make`.
|
||||
[<WoofWare.Myriad.Plugins.HttpClient>]
|
||||
[<Header("User-Agent", "PureGym/1523 CFNetwork/1312 Darwin/21.0.0")>]
|
||||
type IPureGymApi =
|
||||
/// Get the complete list of all gyms known to PureGym.
|
||||
[<Get "v1/gyms/">]
|
||||
abstract GetGyms : ?ct : CancellationToken -> Task<Gym list>
|
||||
|
||||
/// Get information about the PureGym human whose credentials this client is authenticated with.
|
||||
[<Get "v1/member">]
|
||||
abstract GetMember : ?ct : CancellationToken -> Task<Member>
|
||||
|
||||
/// Get information about how full the given gym currently is. The gym ID can be found from `GetGyms`.
|
||||
[<Get "v1/gyms/{gym_id}/attendance">]
|
||||
abstract GetGymAttendance : [<Path "gym_id">] gymId : int * ?ct : CancellationToken -> Task<GymAttendance>
|
||||
|
||||
/// Get information about a specific gym.
|
||||
[<Get "v1/gyms/{gym_id}">]
|
||||
abstract GetGym : [<Path "gym_id">] gymId : int * ?ct : CancellationToken -> Task<Gym>
|
||||
|
||||
/// Get information about the activities logged against the currently authenticated PureGym human.
|
||||
[<Get "v1/member/activity">]
|
||||
abstract GetMemberActivity : ?ct : CancellationToken -> Task<MemberActivityDto>
|
||||
|
||||
/// Get information about the individual visits to all PureGyms the currently-authenticated PureGym human has made.
|
||||
[<Get "v2/gymSessions/member">]
|
||||
abstract GetSessions :
|
||||
[<Query>] fromDate : DateOnly * [<Query>] toDate : DateOnly * ?ct : CancellationToken -> Task<Sessions>
|
||||
|
||||
// [<Get "v1/member/activity/history">]
|
||||
// abstract GetMemberActivityAll : ?ct: CancellationToken -> Task<string>
|
Reference in New Issue
Block a user