8000 Add support for id, next_url & property_item prop by KoditkarVedant · Pull Request #269 · notion-dotnet/notion-sdk-net · GitHub
[go: up one dir, main page]

Skip to content

Add support for id, next_url & property_item prop #269

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Src/Notion.Client/Models/PropertyItems/IPropertyItemObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,14 @@ public interface IPropertyItemObject

[JsonProperty("type")]
string Type { get; }

[JsonProperty("id")]
string Id { get; }

/// <summary>
/// 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.
/// </summary>
[JsonProperty("next_url")]
string NextURL { get; }
}
}
11 changes: 8 additions & 3 deletions Src/Notion.Client/Models/PropertyItems/ListPropertyItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@

namespace Notion.Client
{
[JsonConverter(typeof(JsonSubtypes), "type")]
[JsonSubtypes.KnownSubType(typeof(RollupPropertyItem), "rollup")]
[JsonSubtypes.FallBackSubType(typeof(ListPropertyItem))]
public class ListPropertyItem : IPropertyItemObject
{
public string Object => "list";

public virtual string Type { get; set; }

public string Id { get; set; }

public string NextURL { get; set; }

[JsonProperty("results")]
public IEnumerable<SimplePropertyItem> Results { get; set; }

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

[JsonProperty("next_cursor")]
public string NextCursor { get; set; }

[JsonProperty("property_item")]
public SimplePropertyItem PropertyItem { get; set; }
}
}
12 changes: 0 additions & 12 deletions Src/Notion.Client/Models/PropertyItems/RollupPropertyItem.cs

This file was deleted.

4 changes: 4 additions & 0 deletions Src/Notion.Client/Models/PropertyItems/SimplePropertyItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@ public abstract class SimplePropertyItem : IPropertyItemObject
public string Object => "property_item";

public abstract string Type { get; }

public string Id { get; set; }

public string NextURL { get; set; }
}
}
0