File tree Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ public static class BlocksApiUrls
2424 public static class PagesApiUrls
2525 {
2626 public static string Create ( ) => $ "/v1/pages";
27+ public static string UpdatePageProperties ( string pageId ) => $ "/v1/pages/{ pageId } ";
2728 }
2829 }
2930}
Original file line number Diff line number Diff line change 1- using System . Threading . Tasks ;
1+ using System . Collections . Generic ;
2+ using System . Threading . Tasks ;
23
34namespace Notion . Client
45{
56 public interface IPagesClient
67 {
78 Task < RetrievedPage > CreateAsync ( CreatedPage page ) ;
9+ Task < RetrievedPage > UpdatePagePropertiesAsync (
10+ string pageId ,
11+ IDictionary < string , PropertyValue > updatedProperties
12+ ) ;
13+
814 }
915}
Original file line number Diff line number Diff line change 1- using System . Threading . Tasks ;
1+ using System . Collections . Generic ;
2+ using System . Threading . Tasks ;
23using static Notion . Client . ApiEndpoints ;
34
45namespace Notion . Client
@@ -16,6 +17,20 @@ public async Task<RetrievedPage> CreateAsync(CreatedPage page)
1617 {
1718 return await _client . PostAsync < RetrievedPage > ( PagesApiUrls . Create ( ) , page ) ;
1819 }
19- }
2020
21+ public async Task < RetrievedPage > UpdatePagePropertiesAsync (
22+ string pageId ,
23+ IDictionary < string , PropertyValue > updatedProperties )
24+ {
25+ var url = PagesApiUrls . UpdatePageProperties ( pageId ) ;
26+ var body = new PageUpdatePropertiesParameters { Properties = updatedProperties } ;
27+
28+ return await _client . PatchAsync < RetrievedPage > ( url , body ) ;
29+ }
30+
31+ private class PageUpdatePropertiesParameters
32+ {
33+ public IDictionary < string , PropertyValue > Properties { get ; set ; }
34+ }
35+ }
2136}
You can’t perform that action at this time.
0 commit comments