File tree Expand file tree Collapse file tree 6 files changed +80
-25
lines changed
Src/Notion.Client/Models/Database/Properties Expand file tree Collapse file tree 6 files changed +80
-25
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ using Newtonsoft . Json ;
2+
3+ namespace Notion . Client
4+ {
5+ public class DualPropertyRelation : RelationData
6+ {
7+ public override RelationType Type => RelationType . Dual ;
8+
9+ [ JsonProperty ( "dual_property" ) ]
10+ public Data DualProperty { get ; set ; }
11+
12+ public class Data
13+ {
14+ [ JsonProperty ( "synced_property_name" ) ]
15+ public string SyncedPropertyName { get ; set ; }
16+
17+ [ JsonProperty ( "synced_property_id" ) ]
18+ public string SyncedPropertyId { get ; set ; }
19+ }
20+ }
21+ }
Original file line number Diff line number Diff line change 1+ using JsonSubTypes ;
2+ using Newtonsoft . Json ;
3+ using Newtonsoft . Json . Converters ;
4+
5+ namespace Notion . Client
6+ {
7+ [ JsonConverter ( typeof ( JsonSubtypes ) , "type" ) ]
8+ [ JsonSubtypes . KnownSubType ( typeof ( SinglePropertyRelation ) , RelationType . Single ) ]
9+ [ JsonSubtypes . KnownSubType ( typeof ( DualPropertyRelation ) , RelationType . Dual ) ]
10+ public abstract class RelationData
11+ {
12+ [ JsonProperty ( "database_id" ) ]
13+ public string DatabaseId { get ; set ; }
14+
15+ [ JsonProperty ( "type" ) ]
16+ [ JsonConverter ( typeof ( StringEnumConverter ) ) ]
17+ public virtual RelationType Type { get ; set ; }
18+ }
19+ }
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using System . Runtime . Serialization ;
3+ using Newtonsoft . Json ;
4+
5+ namespace Notion . Client
6+ {
7+ public class RelationProperty : Property
8+ {
9+ public override PropertyType Type => PropertyType . Relation ;
10+
11+ [ JsonProperty ( "relation" ) ]
12+ public RelationData Relation { get ; set ; }
13+ }
14+ }
Original file line number Diff line number Diff line change 1+ using System . Runtime . Serialization ;
2+
3+ namespace Notion . Client
4+ {
5+ public enum RelationType
6+ {
7+ [ EnumMember ( Value = "single_property" ) ]
8+ Single ,
9+
10+ [ EnumMember ( Value = "dual_property" ) ]
11+ Dual
12+ }
13+ }
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 SinglePropertyRelation : RelationData
7+ {
8+ public override RelationType Type => RelationType . Single ;
9+
10+ [ JsonProperty ( "single_property" ) ]
11+ public Dictionary < string , object > SingleProperty { get ; set ; }
12+ }
13+ }
You can’t perform that action at this time.
0 commit comments