File tree Expand file tree Collapse file tree 6 files changed +95
-2
lines changed Expand file tree Collapse file tree 6 files changed +95
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ namespace Notion.Client
2222 [ JsonSubtypes . KnownSubType ( typeof ( RichTextProperty ) , PropertyType . RichText ) ]
2323 [ JsonSubtypes . KnownSubType ( typeof ( RollupProperty ) , PropertyType . Rollup ) ]
2424 [ JsonSubtypes . KnownSubType ( typeof ( SelectProperty ) , PropertyType . Select ) ]
25+ [ JsonSubtypes . KnownSubType ( typeof ( StatusProperty ) , PropertyType . Status ) ]
2526 [ JsonSubtypes . KnownSubType ( typeof ( TitleProperty ) , PropertyType . Title ) ]
2627 [ JsonSubtypes . KnownSubType ( typeof ( UrlProperty ) , PropertyType . Url ) ]
2728 public class Property
Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ public enum PropertyType
6262 LastEditedBy ,
6363
6464 [ EnumMember ( Value = "last_edited_time" ) ]
65- LastEditedTime
65+ LastEditedTime ,
66+
67+ [ EnumMember ( Value = "status" ) ]
68+ Status ,
6669 }
6770}
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using Newtonsoft . Json ;
3+
4+ namespace Notion . Client
5+ {
6+ public class StatusProperty : Property
7+ {
8+ public override PropertyType Type => PropertyType . Status ;
9+
10+ [ JsonProperty ( "status" ) ]
11+ public Dictionary < string , object > Status { get ; set ; }
12+ }
13+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ namespace Notion.Client
2525 [ JsonSubtypes . KnownSubType ( typeof ( RichTextPropertyValue ) , PropertyValueType . RichText ) ]
2626 [ JsonSubtypes . KnownSubType ( typeof ( RollupPropertyValue ) , PropertyValueType . Rollup ) ]
2727 [ JsonSubtypes . KnownSubType ( typeof ( SelectPropertyValue ) , PropertyValueType . Select ) ]
28+ [ JsonSubtypes . KnownSubType ( typeof ( StatusPropertyValue ) , PropertyValueType . Status ) ]
2829 [ JsonSubtypes . KnownSubType ( typeof ( TitlePropertyValue ) , PropertyValueType . Title ) ]
2930 [ JsonSubtypes . KnownSubType ( typeof ( UrlPropertyValue ) , PropertyValueType . Url ) ]
3031 public class PropertyValue
Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ public enum PropertyValueType
6565 LastEditedTime ,
6666
6767 [ EnumMember ( Value = "last_edited_by" ) ]
68- LastEditedBy
68+ LastEditedBy ,
69+
70+ [ EnumMember ( Value = "status" ) ]
71+ Status ,
6972 }
7073}
Original file line number Diff line number Diff line change 1+ using System . Runtime . Serialization ;
2+ using Newtonsoft . Json ;
3+ using Newtonsoft . Json . Converters ;
4+
5+ namespace Notion . Client
6+ {
7+ /// <summary>
8+ /// Status property value objects contain page status
9+ /// </summary>
10+ public class StatusPropertyValue : PropertyValue
11+ {
12+ public override PropertyValueType Type => PropertyValueType . Status ;
13+
14+ [ JsonProperty ( "status" ) ]
15+ public Data Status { get ; set ; }
16+
17+ public class Data
18+ {
19+ /// <summary>
20+ /// ID of the option.
21+ /// </summary>
22+ [ JsonProperty ( "id" ) ]
23+ public string Id { get ; set ; }
24+
25+ /// <summary>
26+ /// Name of the option as it appears in Notion.
27+ /// </summary>
28+ [ JsonProperty ( "name" ) ]
29+ public string Name { get ; set ; }
30+
31+ /// <summary>
32+ /// Color of the option.
33+ /// </summary>
34+ [ JsonProperty ( "color" ) ]
35+ [ JsonConverter ( typeof ( StringEnumConverter ) ) ]
36+ public Color Color { get ; set ; }
37+ }
38+
39+ public enum Color
40+ {
41+ [ EnumMember ( Value = "default" ) ]
42+ Default ,
43+
44+ [ EnumMember ( Value = "gray" ) ]
45+ Gray ,
46+
47+ [ EnumMember ( Value = "brown" ) ]
48+ Brown ,
49+
50+ [ EnumMember ( Value = "orange" ) ]
51+ Orange ,
52+
53+ [ EnumMember ( Value = "yellow" ) ]
54+ Yellow ,
55+
56+ [ EnumMember ( Value = "green" ) ]
57+ Green ,
58+
59+ [ EnumMember ( Value = "blue" ) ]
60+ Blue ,
61+
62+ [ EnumMember ( Value = "purple" ) ]
63+ Purple ,
64+
65+ [ EnumMember ( Value = "pink" ) ]
66+ Pink ,
67+
68+ [ EnumMember ( Value = "red" ) ]
69+ Red ,
70+ }
71+ }
72+ }
You can’t perform that action at this time.
0 commit comments