File tree Expand file tree Collapse file tree 4 files changed +50
-1
lines changed
Src/Notion.Client/Api/Users Expand file tree Collapse file tree 4 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 11using System . Threading ;
22using System . Threading . Tasks ;
3+ using Notion . Client . List . Request ;
34
45namespace Notion . Client
56{
@@ -23,6 +24,11 @@ public interface IUsersClient
2324 /// </returns>
2425 Task < PaginatedList < User > > ListAsync ( CancellationToken cancellationToken = default ) ;
2526
27+ Task < PaginatedList < User > > ListAsync (
28+ ListUsersParameters listUsersParameters ,
29+ CancellationToken cancellationToken = default
30+ ) ;
31+
2632 /// <summary>
2733 /// Retrieves the bot User associated with the API token provided in the authorization header.
2834 /// </summary>
Original file line number Diff line number Diff line change 1+ namespace Notion . Client . List . Request
2+ {
3+ public interface IListUsersQueryParameters : IPaginationParameters
4+ {
5+ }
6+
7+ public class ListUsersParameters : IListUsersQueryParameters
8+ {
9+ public string StartCursor { get ; set ; }
10+
11+ public int ? PageSize { get ; set ; }
12+ }
13+ }
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using System . Threading ;
3+ using System . Threading . Tasks ;
4+ using Notion . Client . List . Request ;
5+
6+ namespace Notion . Client
7+ {
8+ public partial class UsersClient
9+ {
10+ public async Task < PaginatedList < User > > ListAsync (
11+ ListUsersParameters listUsersParameters ,
12+ CancellationToken cancellationToken = default
13+ )
14+ {
15+ var queryParameters = ( IListUsersQueryParameters ) listUsersParameters ;
16+
17+ var queryParams = new Dictionary < string , string >
18+ {
19+ { "start_cursor" , queryParameters ? . StartCursor } ,
20+ { "page_size" , queryParameters ? . PageSize ? . ToString ( ) }
21+ } ;
22+
23+ return await _client . GetAsync < PaginatedList < User > > (
24+ ApiEndpoints . UsersApiUrls . List ( ) ,
25+ queryParams ,
26+ cancellationToken : cancellationToken
27+ ) ;
28+ }
29+ }
30+ }
Original file line number Diff line number Diff line change 44
55namespace Notion . Client
66{
7- public class UsersClient : IUsersClient
7+ public partial class UsersClient : IUsersClient
88 {
99 private readonly IRestClient _client ;
1010
You can’t perform that action at this time.
0 commit comments