Skip to content

Commit 0b43508

Browse files
Merge pull request #158 from notion-dotnet/feature/157-mark-list-database-enpoint-deprecated
Mark database list endpoint obsolete with warning 🗑️
2 parents 7ec3c20 + 2a96fc5 commit 0b43508

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ var complexFiler = new CompoundFilter(
103103
- [x] Create a database
104104
- [x] Update database
105105
- [x] Retrieve a database
106-
- [x] List databases
106+
- [x] List databases (Deprecated: use Search API instead)
107107
- [x] Pages
108108
- [x] Retrieve a page
109109
- [x] Create a page

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23
using System.Threading.Tasks;
34
using static Notion.Client.ApiEndpoints;
45

@@ -18,6 +19,7 @@ public async Task<Database> RetrieveAsync(string databaseId)
1819
return await _client.GetAsync<Database>(DatabasesApiUrls.Retrieve(databaseId));
1920
}
2021

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)]
2123
public async Task<PaginatedList<Database>> ListAsync(DatabasesListParameters databasesListParameters = null)
2224
{
2325
var databasesListQueryParmaters = (IDatabasesListQueryParmaters)databasesListParameters;

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
using System.Threading.Tasks;
1+
using System;
2+
using System.Threading.Tasks;
23

34
namespace Notion.Client
45
{
56
public interface IDatabasesClient
67
{
78
Task<Database> RetrieveAsync(string databaseId);
89
Task<PaginatedList<Page>> QueryAsync(string databaseId, DatabasesQueryParameters databasesQueryParameters);
10+
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)]
917
Task<PaginatedList<Database>> ListAsync(DatabasesListParameters databasesListParameters = null);
1018

1119
/// <summary>

Test/Notion.UnitTests/DatabasesClientTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public DatabasesClientTests()
1919
}
2020

2121
[Fact]
22+
[Obsolete]
2223
public async Task ListDatabasesAsync()
2324
{
2425
var path = ApiEndpoints.DatabasesApiUrls.List();

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var complexFiler = new CompoundFilter(
7070
- [x] Create a database
7171
- [x] Update database
7272
- [x] Retrieve a database
73-
- [x] List databases
73+
- [x] List databases (Deprecated: use Search API instead)
7474
- [x] Pages
7575
- [x] Retrieve a page
7676
- [x] Create a page

0 commit comments

Comments
 (0)