Skip to content

Commit 2eff28f

Browse files
Add support for Verification Property
1 parent feec5eb commit 2eff28f

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

Src/Notion.Client/Models/PropertyValue/PropertyValue.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ namespace Notion.Client
3030
[JsonSubtypes.KnownSubTypeAttribute(typeof(TitlePropertyValue), PropertyValueType.Title)]
3131
[JsonSubtypes.KnownSubTypeAttribute(typeof(UrlPropertyValue), PropertyValueType.Url)]
3232
[JsonSubtypes.KnownSubTypeAttribute(typeof(UniqueIdPropertyValue), PropertyValueType.UniqueId)]
33+
[JsonSubtypes.KnownSubTypeAttribute(typeof(VerificationPropertyValue), PropertyValueType.Verification)]
3334
[SuppressMessage("ReSharper", "UnusedMember.Global")]
3435
[SuppressMessage("ReSharper", "UnassignedGetOnlyAutoProperty")]
3536
public class PropertyValue

Src/Notion.Client/Models/PropertyValue/PropertyValueType.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,8 @@ public enum PropertyValueType
7474

7575
[EnumMember(Value = "unique_id")]
7676
UniqueId,
77+
78+
[EnumMember(Value = "verification")]
79+
Verification,
7780
}
7881
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Notion.Client
4+
{
5+
/// <summary>
6+
/// Verification property value.
7+
/// </summary>
8+
public class VerificationPropertyValue : PropertyValue
9+
{
10+
public override PropertyValueType Type => PropertyValueType.Verification;
11+
12+
/// <summary>
13+
/// Object containing verification type-specific data.
14+
/// </summary>
15+
[JsonProperty("verification")]
16+
public Info Verification { get; set; }
17+
18+
public class Info
19+
{
20+
/// <summary>
21+
/// The state of verification. Possible values are "verified" and "unverified".
22+
/// </summary>
23+
[JsonProperty("state")]
24+
public string State { get; set; }
25+
26+
/// <summary>
27+
/// Describes the user who verified this page.
28+
/// </summary>
29+
[JsonProperty("verified_by")]
30+
public User VerifiedBy { get; set; }
31+
32+
/// <summary>
33+
/// Date verification property values contain a date property value.
34+
/// </summary>
35+
[JsonProperty("date")]
36+
public Date Date { get; set; }
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)