Skip to content

Commit 55dc049

Browse files
Merge pull request #224 from notion-dotnet/220-convert-enum-to-string-to-avoid-parsing-issues
Convert Rollup Function type to string
2 parents 74cea63 + e67ec28 commit 55dc049

File tree

3 files changed

+4
-61
lines changed

3 files changed

+4
-61
lines changed

Src/Notion.Client/Api/Databases/RequestParams/DatabasesCreateParameters/PropertySchema/RollupConfigPropertySchema.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Newtonsoft.Json;
2-
using Newtonsoft.Json.Converters;
32

43
namespace Notion.Client
54
{
@@ -18,7 +17,6 @@ public class RollupConfigPropertySchema : IPropertySchema
1817
public string RollupPropertyId { get; set; }
1918

2019
[JsonProperty("function")]
21-
[JsonConverter(typeof(StringEnumConverter))]
22-
public Function Function { get; set; }
20+
public string Function { get; set; }
2321
}
2422
}

Src/Notion.Client/Api/Databases/RequestParams/DatabasesUpdateParameters/PropertySchema/RollupConfigUpdatePropertySchema.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Newtonsoft.Json;
2-
using Newtonsoft.Json.Converters;
32

43
namespace Notion.Client
54
{
@@ -18,7 +17,6 @@ public class RollupConfigUpdatePropertySchema : UpdatePropertySchema, IUpdatePro
1817
public string RollupPropertyId { get; set; }
1918

2019
[JsonProperty("function")]
21-
[JsonConverter(typeof(StringEnumConverter))]
22-
public Function Function { get; set; }
20+
public string Function { get; set; }
2321
}
2422
}
Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Runtime.Serialization;
2-
using Newtonsoft.Json;
3-
using Newtonsoft.Json.Converters;
1+
using Newtonsoft.Json;
42

53
namespace Notion.Client
64
{
@@ -27,57 +25,6 @@ public class Rollup
2725
public string RollupPropertyId { get; set; }
2826

2927
[JsonProperty("function")]
30-
[JsonConverter(typeof(StringEnumConverter))]
31-
public Function Function { get; set; }
32-
}
33-
34-
public enum Function
35-
{
36-
[EnumMember(Value = null)]
37-
Unknown,
38-
39-
[EnumMember(Value = "count_all")]
40-
CountAll,
41-
[EnumMember(Value = "count_values")]
42-
CountValues,
43-
44-
[EnumMember(Value = "count_unique_values")]
45-
CountUniqueValues,
46-
47-
[EnumMember(Value = "count_empty")]
48-
CountEmpty,
49-
50-
[EnumMember(Value = "count_not_empty")]
51-
CountNotEmpty,
52-
53-
[EnumMember(Value = "percent_empty")]
54-
PercentEmpty,
55-
56-
[EnumMember(Value = "percent_not_empty")]
57-
PercentNotEmpty,
58-
59-
[EnumMember(Value = "sum")]
60-
Sum,
61-
62-
[EnumMember(Value = "average")]
63-
Average,
64-
65-
[EnumMember(Value = "median")]
66-
Median,
67-
68-
[EnumMember(Value = "min")]
69-
Min,
70-
71-
[EnumMember(Value = "max")]
72-
Max,
73-
74-
[EnumMember(Value = "range")]
75-
Range,
76-
77-
[EnumMember(Value = "show_original")]
78-
ShowOriginal,
79-
80-
[EnumMember(Value = "show_unique")]
81-
ShowUnique
28+
public string Function { get; set; }
8229
}
8330
}

0 commit comments

Comments
 (0)