forked from JustDerb/Tiltify-Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUsers.cs
29 lines (27 loc) · 809 Bytes
/
Users.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System.Threading.Tasks;
using Tiltify.Models;
namespace Tiltify
{
public class Users : ApiBase
{
public Users(ApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http) : base(settings, rateLimiter, http)
{
}
public Task<GetUserResponse> GetUser()
{
ApiVersion version = GetApiVersion();
string endpointPath;
switch (version)
{
default:
case ApiVersion.V3:
endpointPath = "/user";
break;
case ApiVersion.V5:
endpointPath = "/current-user";
break;
}
return TiltifyGetGenericAsync<GetUserResponse>(endpointPath, version);
}
}
}