This repository was archived by the owner on May 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathUser.cs
More file actions
49 lines (44 loc) · 1.25 KB
/
User.cs
File metadata and controls
49 lines (44 loc) · 1.25 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System.Threading.Tasks;
using LeanKit.Models;
using System.Collections.Generic;
namespace LeanKit.API
{
public class User
{
private readonly Client _client;
private readonly UserBoards _boards;
public User(Client client)
{
_client = client;
_boards = new UserBoards(client);
}
public UserBoards Boards
{
get { return _boards; }
}
public async Task<UserListResponse> List(UserListRequest request = null)
{
var parameters = new Dictionary<string, string>();
if (request != null)
{
if (request.Offset.HasValue)
{
parameters.Add("offset", request.Offset.Value.ToString());
}
if (request.Limit.HasValue)
{
parameters.Add("limit", request.Limit.Value.ToString());
}
}
return await _client.Request<UserListResponse>("io/user", parameters: parameters);
}
public async Task<UserResponse> Get(long userId)
{
return await _client.Request<UserResponse>(string.Format("io/user/{0}", userId));
}
public async Task<UserResponse> Me()
{
return await _client.Request<UserResponse>("io/user/me");
}
}
}