8000 Exposed IRestClient · hognevevle/notion-sdk-net@13e87c0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 13e87c0

Browse files
author
Dainius Lukša
committed
Exposed IRestClient
1 parent 2cd0f91 commit 13e87c0

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-< 10000 !-- -->7
lines changed

Src/Notion.Client/NotionClient.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,27 @@ public interface INotionClient
77
IPagesClient Pages { get; }
88
ISearchClient Search { get; }
99
IBlocksClient Blocks { get; }
10+
IRestClient RestClient { get; }
1011
}
1112

1213
public class NotionClient : INotionClient
1314
{
15+
1416
public NotionClient(ClientOptions options)
1517
{
16-
var restClient = new RestClient(options);
17-
Users = new UsersClient(restClient);
18-
Databases = new DatabasesClient(restClient);
19-
Pages = new PagesClient(restClient);
20-
Search = new SearchClient(restClient);
21-
Blocks = new BlocksClient(restClient);
18+
RestClient = new RestClient(options);
19+
Users = new UsersClient(RestClient);
20+
Databases = new DatabasesClient(RestClient);
21+
Pages = new PagesClient(RestClient);
22+
Search = new SearchClient(RestClient);
23+
Blocks = new BlocksClient(RestClient);
2224
}
2325

2426
public IUsersClient Users { get; }
2527
public IDatabasesClient Databases { get; }
2628
public IPagesClient Pages { get; }
2729
public ISearchClient Search { get; }
2830
public IBlocksClient Blocks { get; }
31+
public IRestClient RestClient { get; }
2932
}
3033
}

Src/Notion.Client/RestClient/RestClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private static async Task<Exception> BuildException(HttpResponseMessage response
7272
return new NotionApiException(response.StatusCode, errorResponse?.ErrorCode, errorResponse?.Message);
7373
}
7474

75-
private async Task<HttpResponseMessage> SendAsync(
75+
public async Task<HttpResponseMessage> SendAsync(
7676
string requestUri,
7777
HttpMethod httpMethod,
7878
IDictionary<string, string> queryParams = null,

0 commit comments

Comments
 (0)
0