File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Src/Notion.Client/Api/Pages/RequestParams/PagesCreateParameters Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+
3+ namespace Notion . Client
4+ {
5+ public class PagesCreateParametersBuilder
6+ {
7+ private IPageParent parent ;
8+ private Dictionary < string , PropertyValue > properties = new Dictionary < string , PropertyValue > ( ) ;
9+ private IList < Block > children = new List < Block > ( ) ;
10+ private IPageIcon icon ;
11+ private FileObject cover ;
12+
13+ private PagesCreateParametersBuilder ( )
14+ {
15+ }
16+
17+ public static PagesCreateParametersBuilder Create ( IPageParent parent )
18+ {
19+ return new PagesCreateParametersBuilder {
20+ parent = parent
21+ } ;
22+ }
23+
24+ public PagesCreateParametersBuilder AddProperty ( string nameOrId , PropertyValue value )
25+ {
26+ properties [ nameOrId ] = value ;
27+ return this ;
28+ }
29+
30+ public PagesCreateParametersBuilder AddPageContent ( Block block )
31+ {
32+ children . Add ( block ) ;
33+ return this ;
34+ }
35+
36+ public PagesCreateParameters Build ( )
37+ {
38+ return new PagesCreateParameters
39+ {
40+ Parent = parent ,
41+ Properties = properties ,
42+ Children = children ,
43+ Icon = icon ,
44+ Cover = cover
45+ } ;
46+ }
47+ }
48+ }
You can’t perform that action at this time.
0 commit comments