8000 Merge branch 'notion-version-2022-02-22' of github.com:notion-dotnet/… · notion-dotnet/notion-sdk-net@c934d05 · GitHub
[go: up one dir, main page]

Skip to content

Commit c934d05

Browse files
Merge branch 'notion-version-2022-02-22' of github.com:notion-dotnet/notion-sdk-net into notion-version-2022-02-22
2 parents f309683 + f0b7ad2 commit c934d05

File tree

5 files changed

+2
-57
lines changed

5 files changed

+2
-57
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ var complexFiler = new CompoundFilter(
113113
- [x] Create a database
114114
- [x] Update database
115115
- [x] Retrieve a database
116-
- [x] List databases (Deprecated: use Search API instead)
117116
- [x] Pages
118117
- [x] Retrieve a page
119118
- [x] Create a page

Src/Notion.Client/Api/Databases/DatabasesClient.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Threading.Tasks;
1+
using System.Threading.Tasks;
42
using static Notion.Client.ApiEndpoints;
53

64
namespace Notion.Client
@@ -19,20 +17,6 @@ public async Task<Database> RetrieveAsync(string databaseId)
1917
return await _client.GetAsync<Database>(DatabasesApiUrls.Retrieve(databaseId));
2018
}
2119

22-
[Obsolete("This endpoint is no longer recommended, use Search instead. This endpoint will only return explicitly shared pages, while search will also return child pages within explicitly shared pages. This endpoint's results cannot be filtered, while search can be used to match on page title.", false)]
23-
public async Task<PaginatedList<Database>> ListAsync(DatabasesListParameters databasesListParameters = null)
24-
{
25-
var databasesListQueryParmaters = (IDatabasesListQueryParmaters)databasesListParameters;
26-
27-
var queryParams = new Dictionary<string, string>()
28-
{
29-
{ "start_cursor", databasesListQueryParmaters?.StartCursor },
30-
{ "page_size", databasesListQueryParmaters?.PageSize?.ToString() }
31-
};
32-
33-
return await _client.GetAsync<PaginatedList<Database>>(DatabasesApiUrls.List(), queryParams);
34-
}
35-
3620
public async Task<PaginatedList<Page>> QueryAsync(string databaseId, DatabasesQueryParameters databasesQueryParameters)
3721
{
3822
var body = (IDatabaseQueryBodyParameters)databasesQueryParameters;

Src/Notion.Client/Api/Databases/IDatabasesClient.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Threading.Tasks;
1+
using System.Threading.Tasks;
32

43
namespace Notion.Client
54
{
@@ -8,14 +7,6 @@ public interface IDatabasesClient
87
Task<Database> RetrieveAsync(string databaseId);
98
Task<PaginatedList<Page>> QueryAsync(string databaseId, DatabasesQueryParameters databasesQueryParameters);
109

11-
/// <summary>
12-
/// List all Databases shared with the authenticated integration.
13-
/// </summary>
14-
/// <param name="databasesListParameters">database list request parameters.</param>
15-
/// <returns>PaginatedList of databases.</returns>
16-
[Obsolete("This endpoint is no longer recommended, use Search instead. This endpoint will only return explicitly shared pages, while search will also return child pages within explicitly shared pages. This endpoint's results cannot be filtered, while search can be used to match on page title.", false)]
17-
Task<PaginatedList<Database>> ListAsync(DatabasesListParameters databasesListParameters = null);
18-
1910
/// <summary>
2011
/// Creates a database as a subpage in the specified parent page, with the specified properties schema.
2112
/// </summary>

Test/Notion.UnitTests/DatabasesClientTests.cs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,6 @@ public DatabasesClientTests()
1818
_client = new DatabasesClient(new RestClient(ClientOptions));
1919
}
2020

21-
[Fact]
22-
[Obsolete]
23-
public async Task ListDatabasesAsync()
24-
{
25-
var path = ApiEndpoints.DatabasesApiUrls.List();
26-
var jsonData = await File.ReadAllTextAsync("data/databases/DatabasesListResponse.json");
27-
28-
Server.Given(CreateGetRequestBuilder(path))
29-
.RespondWith(
30-
Response.Create()
31-
.WithStatusCode(200)
32-
.WithBody(jsonData)
33-
);
34-
35-
var databases = await _client.ListAsync();
36-
37-
databases.Results.Should().HaveCount(3);
38-
39-
foreach (var database in databases.Results)
40-
{
41-
database.Parent.Should().BeAssignableTo<IDatabaseParent>();
42-
foreach (var property in database.Properties)
43-
{
44-
property.Key.Should().Be(property.Value.Name);
45-
}
46-
}
47-
}
48-
4921
[Fact]
5022
public async Task QueryAsync()
5123
{

docs/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ var complexFiler = new CompoundFilter(
8080
- [x] Create a database
8181
- [x] Update database
8282
- [x] Retrieve a database
83-
- [x] List databases (Deprecated: use Search API instead)
8483
- [x] Pages
8584
- [x] Retrieve a page
8685
- [x] Create a page

0 commit comments

Comments
 (0)
0