Skip to content

Commit 8ea5ef4

Browse files
Move Database, Property & RichText into separate files 🚚
1 parent 463a4f9 commit 8ea5ef4

27 files changed

+659
-552
lines changed

Src/Notion.Client/Models/Database.cs

Lines changed: 0 additions & 552 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Runtime.Serialization;
4+
using JsonSubTypes;
5+
using Newtonsoft.Json;
6+
using Newtonsoft.Json.Converters;
7+
8+
namespace Notion.Client
9+
{
10+
public interface IDatabasesListQueryParmaters : IPaginationParameters
11+
{
12+
13+
}
14+
15+
public class DatabasesListParameters : IDatabasesListQueryParmaters
16+
{
17+
public string StartCursor { get; set; }
18+
public string PageSize { get; set; }
19+
}
20+
21+
22+
public interface IDatabaseQueryBodyParameters : IPaginationParameters
23+
{
24+
Filter Filter { get; set; }
25+
List<Sort> Sorts { get; set; }
26+
}
27+
28+
public class DatabasesQueryParameters : IDatabaseQueryBodyParameters
29+
{
30+
public Filter Filter { get; set; }
31+
public List<Sort> Sorts { get; set; }
32+
public string StartCursor { get; set; }
33+
public string PageSize { get; set; }
34+
}
35+
36+
public class Database
37+
{
38+
public string Object => "database";
39+
public string Id { get; set; }
40+
41+
[JsonProperty("created_time")]
42+
public DateTime CreatedTime { get; set; }
43+
44+
45+
[JsonProperty("last_edited_time")]
46+
public DateTime LastEditedTime { get; set; }
47+
48+
public List<RichTextBase> Title { get; set; }
49+
50+
public Dictionary<string, Property> Properties { get; set; }
51+
}
52+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Collections.Generic;
2+
3+
namespace Notion.Client
4+
{
5+
public class CheckboxProperty : Property
6+
{
7+
public override PropertyType Type => PropertyType.Checkbox;
8+
public Dictionary<string, object> Checkbox { get; set; }
9+
}
10+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using Newtonsoft.Json;
2+
using System.Collections.Generic;
3+
4+
namespace Notion.Client
5+
{
6+
public class CreatedByProperty : Property
7+
{
8+
public override PropertyType Type => PropertyType.CreatedBy;
9+
10+
[JsonProperty("created_by")]
11+
public Dictionary<string, object> CreatedBy { get; set; }
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using Newtonsoft.Json;
2+
using System.Collections.Generic;
3+
4+
namespace Notion.Client
5+
{
6+
public class CreatedTimeProperty : Property
7+
{
8+
public override PropertyType Type => PropertyType.CreatedTime;
9+
10+
[JsonProperty("created_time")]
11+
public Dictionary<string, object> CreatedTime { get; set; }
12+
}
13+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Collections.Generic;
2+
3+
namespace Notion.Client
4+
{
5+
public class DateProperty : Property
6+
{
7+
public override PropertyType Type => PropertyType.MultiSelect;
8+
public Dictionary<string, object> Date { get; set; }
9+
}
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Collections.Generic;
2+
3+
namespace Notion.Client
4+
{
5+
public class EmailProperty : Property
6+
{
7+
public override PropertyType Type => PropertyType.Email;
8+
public Dictionary<string, object> Email { get; set; }
9+
}
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Collections.Generic;
2+
3+
namespace Notion.Client
4+
{
5+
public class FileProperty : Property
6+
{
7+
public override PropertyType Type => PropertyType.File;
8+
public Dictionary<string, object> File { get; set; }
9+
}
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace Notion.Client
2+
{
3+
public class FormulaProperty : Property
4+
{
5+
public override PropertyType Type => PropertyType.Formula;
6+
7+
public Formula Formula { get; set; }
8+
}
9+
10+
public class Formula
11+
{
12+
public string Expression { get; set; }
13+
}
14+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using Newtonsoft.Json;
2+
using System.Collections.Generic;
3+
4+
namespace Notion.Client
5+
{
6+
public class LastEditedByProperty : Property
7+
{
8+
public override PropertyType Type => PropertyType.LastEditedBy;
9+
10+
[JsonProperty("last_edited_by")]
11+
public Dictionary<string, object> LastEditedBy { get; set; }
12+
}
13+
}

0 commit comments

Comments
 (0)