File tree 16 files changed +26
-18
lines changed
Api/Databases/RequestParams/DatabasesCreateParameters/PropertySchema
Test/Notion.IntegrationTests
16 files changed +26
-18
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ public class SelectOptionSchema
10
10
11
11
[ JsonProperty ( "color" ) ]
12
12
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
13
- public Color Color { get ; set ; }
13
+ public Color ? Color { get ; set ; }
14
14
}
15
15
}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public class Info
18
18
19
19
[ JsonProperty ( "color" ) ]
20
20
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
21
- public Color Color { get ; set ; }
21
+ public Color ? Color { get ; set ; }
22
22
23
23
[ JsonProperty ( "children" ) ]
24
24
public IEnumerable < INonColumnBlock > Children { get ; set ; }
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public class Info
21
21
22
22
[ JsonProperty ( "color" ) ]
23
23
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
24
- public Color Color { get ; set ; }
24
+ public Color ? Color { get ; set ; }
25
25
26
26
[ JsonProperty ( "children" ) ]
27
27
public IEnumerable < INonColumnBlock > Children { get ; set ; }
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public class Info
20
20
21
21
[ JsonProperty ( "color" ) ]
22
22
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
23
- public Color Color { get ; set ; }
23
+ public Color ? Color { get ; set ; }
24
24
}
25
25
}
26
26
}
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public class Info
20
20
21
21
[ JsonProperty ( "color" ) ]
22
22
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
23
- public Color Color { get ; set ; }
23
+ public Color ? Color { get ; set ; }
24
24
}
25
25
}
26
26
}
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public class Info
20
20
21
21
[ JsonProperty ( "color" ) ]
22
22
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
23
- public Color Color { get ; set ; }
23
+ public Color ? Color { get ; set ; }
24
24
}
25
25
}
26
26
}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public class Info
18
18
19
19
[ JsonProperty ( "color" ) ]
20
20
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
21
- public Color Color { get ; set ; }
21
+ public Color ? Color { get ; set ; }
22
22
23
23
[ JsonProperty ( "children" ) ]
24
24
public IEnumerable < INonColumnBlock > Children { get ; set ; }
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public class Info
18
18
19
19
[ JsonProperty ( "color" ) ]
20
20
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
21
- public Color Color { get ; set ; }
21
+ public Color ? Color { get ; set ; }
22
22
23
23
[ JsonProperty ( "children" ) ]
24
24
public IEnumerable < INonColumnBlock > Children { get ; set ; }
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public class Info
18
18
19
19
[ JsonProperty ( "color" ) ]
20
20
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
21
- public Color Color { get ; set ; }
21
+ public Color ? Color { get ; set ; }
22
22
23
23
[ JsonProperty ( "children" ) ]
24
24
public IEnumerable < INonColumnBlock > Children { get ; set ; }
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public class Data
14
14
{
15
15
[ JsonProperty ( "color" ) ]
16
16
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
17
- public Color Color { get ; set ; }
17
+ public Color ? Color { get ; set ; }
18
18
}
19
19
}
20
20
}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public class Info
21
21
22
22
[ JsonProperty ( "color" ) ]
23
23
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
24
- public Color Color { get ; set ; }
24
+ public Color ? Color { get ; set ; }
25
25
26
26
[ JsonProperty ( "children" ) ]
27
27
public IEnumerable < INonColumnBlock > Children { get ; set ; }
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public class Info
18
18
19
19
[ JsonProperty ( "color" ) ]
20
20
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
21
- public Color Color { get ; set ; }
21
+ public Color ? Color { get ; set ; }
22
22
23
23
[ JsonProperty ( "children" ) ]
24
24
public IEnumerable < INonColumnBlock > Children { get ; set ; }
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public class SelectOption
35
35
/// </summary>
36
36
[ JsonProperty ( "color" ) ]
37
37
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
38
- public Color Color { get ; set ; }
38
+ public Color ? Color { get ; set ; }
39
39
}
40
40
41
41
public class MultiSelectProperty : Property
Original file line number Diff line number Diff line change @@ -43,6 +43,6 @@ public class Annotations
43
43
44
44
[ JsonProperty ( "color" ) ]
45
45
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
46
- public Color Color { get ; set ; }
46
+ public Color ? Color { get ; set ; }
47
47
}
48
48
}
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public class Data
33
33
/// </summary>
34
34
[ JsonProperty ( "color" ) ]
35
35
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
36
- public Color Color { get ; set ; }
36
+ public Color ? Color { get ; set ; }
37
37
}
38
38
39
39
public enum Color
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ public async Task Test_RetrievePagePropertyItemAsync()
142
142
143
143
var listProperty = ( ListPropertyItem ) property ;
144
144
145
- listProperty . Type . Should ( ) . BeNull ( ) ;
145
+ listProperty . Type . Should ( ) . NotBeNull ( ) ;
146
146
listProperty . Results . Should ( ) . SatisfyRespectively ( p =>
147
147
{
148
148
p . Should ( ) . BeOfType < TitlePropertyItem > ( ) ;
@@ -202,7 +202,11 @@ public async Task Test_UpdatePageProperty_with_date_as_null()
202
202
203
203
var page = await _client . Pages . CreateAsync ( pagesCreateParameters ) ;
204
204
205
- var setDate = page . Properties [ datePropertyName ] as DatePropertyValue ;
205
+ var setDate = ( DatePropertyItem ) await _client . Pages . RetrievePagePropertyItem ( new RetrievePropertyItemParameters
206
+ {
207
+ PageId = page . Id ,
208
+ PropertyId = page . Properties [ datePropertyName ] . Id
209
+ } ) ;
206
210
207
211
setDate ? . Date ? . Start . Should ( ) . Be ( Convert . ToDateTime ( "2020-12-08T12:00:00Z" ) ) ;
208
212
@@ -215,7 +219,11 @@ public async Task Test_UpdatePageProperty_with_date_as_null()
215
219
Properties = testProps
216
220
} ) ;
217
221
218
- var verifyDate = updatedPage . Properties [ datePropertyName ] as DatePropertyValue ;
222
+ var verifyDate = ( DatePropertyItem ) await _client . Pages . RetrievePagePropertyItem ( new RetrievePropertyItemParameters
223
+ {
224
+ PageId = page . Id ,
225
+ PropertyId = updatedPage . Properties [ datePropertyName ] . Id
226
+ } ) ;
219
227
220
228
verifyDate ? . Date . Should ( ) . BeNull ( ) ;
221
229
You can’t perform that action at this time.
0 commit comments