Skip to content

Commit c35d522

Browse files
Mark database list endpoint obsolete with warning 🗑️
1 parent 7ec3c20 commit c35d522

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

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();

0 commit comments

Comments
 (0)