Skip to content

325 Add missing property item #326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Src/Notion.Client/Models/PropertyItems/RollupPropertyItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
public class RollupPropertyItem : SimplePropertyItem
{
public override string Type => "rollup";

[JsonProperty("rollup")] public Data Rollup { get; set; }

public class Data
{
[JsonProperty("type")] public string Type { get; set; }

[JsonProperty("function")] public string Function { get; set; }

[JsonProperty("number")] public double? Number { get; set; }

[JsonProperty("date")] public Date Date { get; set; }

[JsonProperty("array")] public IEnumerable<Dictionary<string, object>> Array { get; set; }

[JsonProperty("unsupported")] public Dictionary<string, object> Unsupported { get; set; }

[JsonProperty("incomplete")] public Dictionary<string, object> Incomplete { get; set; }
}
}
}
2 changes: 2 additions & 0 deletions Src/Notion.Client/Models/PropertyItems/SimplePropertyItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Notion.Client
[JsonSubtypes.KnownSubType(typeof(UrlPropertyItem), "url")]
[JsonSubtypes.KnownSubType(typeof(SelectPropertyItem), "select")]
[JsonSubtypes.KnownSubType(typeof(MultiSelectPropertyItem), "multi_select")]
[JsonSubtypes.KnownSubType(typeof(StatusPropertyItem), "status")]
[JsonSubtypes.KnownSubType(typeof(DatePropertyItem), "date")]
[JsonSubtypes.KnownSubType(typeof(EmailPropertyItem), "email")]
[JsonSubtypes.KnownSubType(typeof(PhoneNumberPropertyItem), "phone_number")]
Expand All @@ -22,6 +23,7 @@ namespace Notion.Client
[JsonSubtypes.KnownSubType(typeof(RichTextPropertyItem), "rich_text")]
[JsonSubtypes.KnownSubType(typeof(PeoplePropertyItem), "people")]
[JsonSubtypes.KnownSubType(typeof(RelationPropertyItem), "relation")]
[JsonSubtypes.KnownSubType(typeof(RollupPropertyItem), "rollup")]
public abstract class SimplePropertyItem : IPropertyItemObject
{
public string Object => "property_item";
Expand Down
11 changes: 11 additions & 0 deletions Src/Notion.Client/Models/PropertyItems/StatusPropertyItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Newtonsoft.Json;

namespace Notion.Client
{
public class StatusPropertyItem : SimplePropertyItem
{
public override string Type => "status";

[JsonProperty("status")] public SelectOption Status { get; set; }
}
}
X