File tree Expand file tree Collapse file tree 2 files changed +32
-7
lines changed Expand file tree Collapse file tree 2 files changed +32
-7
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,20 @@ public interface INotionClient
1212
1313 public class NotionClient : INotionClient
1414 {
15- public NotionClient ( ClientOptions options )
15+ public NotionClient (
16+ RestClient restClient ,
17+ UsersClient users ,
18+ DatabasesClient databases ,
19+ PagesClient pages ,
20+ SearchClient search ,
21+ BlocksClient blocks )
1622 {
17- RestClient = new RestClient ( options ) ;
18- Users = new UsersClient ( RestClient ) ;
19- Databases = new DatabasesClient ( RestClient ) ;
20- Pages = new PagesClient ( RestClient ) ;
21- Search = new SearchClient ( RestClient ) ;
22- Blocks = new BlocksClient ( RestClient ) ;
23+ RestClient = restClient ;
24+ Users = users ;
25+ Databases = databases ;
26+ Pages = pages ;
27+ Search = search ;
28+ Blocks = blocks ;
2329 }
2430
2531 public IUsersClient Users { get ; }
Original file line number Diff line number Diff line change 1+ namespace Notion . Client
2+ {
3+ public static class NotionClientFactory
4+ {
5+ public static NotionClient Create ( ClientOptions options )
6+ {
7+ var restClient = new RestClient ( options ) ;
8+
9+ return new NotionClient (
10+ restClient : restClient
11+ , users : new UsersClient ( restClient )
12+ , databases : new DatabasesClient ( restClient )
13+ , pages : new PagesClient ( restClient )
14+ , search : new SearchClient ( restClient )
15+ , blocks : new BlocksClient ( restClient )
16+ ) ;
17+ }
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments