Skip to content

Commit 331819d

Browse files
Merge pull request #269 from notion-dotnet/244-property_item-objects-now-return-a-type-next_url-and-id
Add support for id, next_url & property_item prop to PropertyItem object ✨
2 parents 9985c00 + 3c252dd commit 331819d

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

Src/Notion.Client/Models/PropertyItems/IPropertyItemObject.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,14 @@ public interface IPropertyItemObject
1313

1414
[JsonProperty("type")]
1515
string Type { get; }
16+
17+
[JsonProperty("id")]
18+
string Id { get; }
19+
20+
/// <summary>
21+
/// Only present in paginated property values with another page of results. If present, the url the user can request to get the next page of results.
22+
/// </summary>
23+
[JsonProperty("next_url")]
24+
string NextURL { get; }
1625
}
1726
}

Src/Notion.Client/Models/PropertyItems/ListPropertyItem.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44

55
namespace Notion.Client
66
{
7-
[JsonConverter(typeof(JsonSubtypes), "type")]
8-
[JsonSubtypes.KnownSubType(typeof(RollupPropertyItem), "rollup")]
9-
[JsonSubtypes.FallBackSubType(typeof(ListPropertyItem))]
107
public class ListPropertyItem : IPropertyItemObject
118
{
129
public string Object => "list";
10+
1311
public virtual string Type { get; set; }
1412

13+
public string Id { get; set; }
14+
15+
public string NextURL { get; set; }
16+
1517
[JsonProperty("results")]
1618
public IEnumerable<SimplePropertyItem> Results { get; set; }
1719

@@ -20,5 +22,8 @@ public class ListPropertyItem : IPropertyItemObject
2022

2123
[JsonProperty("next_cursor")]
2224
public string NextCursor { get; set; }
25+
26+
[JsonProperty("property_item")]
27+
public SimplePropertyItem PropertyItem { get; set; }
2328
}
2429
}

Src/Notion.Client/Models/PropertyItems/RollupPropertyItem.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

Src/Notion.Client/Models/PropertyItems/SimplePropertyItem.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,9 @@ public abstract class SimplePropertyItem : IPropertyItemObject
2727
public string Object => "property_item";
2828

2929
public abstract string Type { get; }
30+
31+
public string Id { get; set; }
32+
33+
public string NextURL { get; set; }
3034
}
3135
}

0 commit comments

Comments
 (0)