Skip to content

Commit 1a3efb1

Browse files
Merge pull request #292 from notion-dotnet/3.1.0
3.1.0
2 parents 74e57eb + 1e32301 commit 1a3efb1

File tree

13 files changed

+249
-17
lines changed

13 files changed

+249
-17
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,9 @@ public class DatabasesCreateParameters : IDatabasesCreateBodyParameters, IDataba
1919

2020
[JsonProperty("cover")]
2121
public FileObject Cover { get; set; }
22+
23+
public bool? IsInline { get; set; }
24+
25+
public string Description { get; set; }
2226
}
2327
}

Src/Notion.Client/Api/Databases/RequestParams/DatabasesCreateParameters/IDatabasesCreateBodyParameters.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,11 @@ public interface IDatabasesCreateBodyParameters
1313

1414
[JsonProperty("title")]
1515
List<RichTextBaseInput> Title { get; set; }
16+
17+
[JsonProperty("is_inline")]
18+
bool? IsInline { get; set; }
19+
20+
[JsonProperty("description")]
21+
string Description { get; set; }
1622
}
1723
}

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

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,20 @@
33

44
namespace Notion.Client
55
{
6-
public interface IDatabasesUpdateBodyParameters
7-
{
8-
[JsonProperty("properties")]
9-
Dictionary<string, IUpdatePropertySchema> Properties { get; set; }
10-
11-
[JsonProperty("title")]
12-
List<RichTextBaseInput> Title { get; set; }
13-
14-
[JsonProperty("icon")]
15-
IPageIcon Icon { get; set; }
16-
17-
[JsonProperty("cover")]
18-
FileObject Cover { get; set; }
19-
}
20-
216
public class DatabasesUpdateParameters : IDatabasesUpdateBodyParameters
227
{
238
public Dictionary<string, IUpdatePropertySchema> Properties { get; set; }
9+
2410
public List<RichTextBaseInput> Title { get; set; }
11+
2512
public IPageIcon Icon { get; set; }
13+
2614
public FileObject Cover { get; set; }
15+
16+
public bool Archived { get; set; }
17+
18+
public bool? IsInline { get; set; }
19+
20+
public string Description { get; set; }
2721
}
2822
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System.Collections.Generic;
2+
using Newtonsoft.Json;
3+
4+
namespace Notion.Client
5+
{
6+
public interface IDatabasesUpdateBodyParameters
7+
{
8+
[JsonProperty("properties")]
9+
Dictionary<string, IUpdatePropertySchema> Properties { get; set; }
10+
11+
[JsonProperty("title")]
12+
List<RichTextBaseInput> Title { get; set; }
13+
14+
[JsonProperty("icon")]
15+
IPageIcon Icon { get; set; }
16+
17+
[JsonProperty("cover")]
18+
FileObject Cover { get; set; }
19+
20+
[JsonProperty("archived")]
21+
bool Archived { get; set; }
22+
23+
[JsonProperty("is_inline")]
24+
bool? IsInline { get; set; }
25+
26+
[JsonProperty("description")]
27+
string Description { get; set; }
28+
}
29+
}

Src/Notion.Client/Models/Database/Database.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,20 @@ public class Database : IObject, IObjectModificationData
3737
[JsonProperty("url")]
3838
public string Url { get; set; }
3939

40+
/// <summary>
41+
/// The archived status of the database.
42+
/// </summary>
43+
[JsonProperty("archived")]
44+
public bool Archived { get; set; }
45+
4046
public PartialUser CreatedBy { get; set; }
4147

4248
public PartialUser LastEditedBy { get; set; }
49+
50+
[JsonProperty("is_inline")]
51+
public bool IsInline { get; set; }
52+
53+
[JsonProperty("description")]
54+
public string Description { get; set; }
4355
}
4456
}

Src/Notion.Client/Models/Database/Properties/Property.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ namespace Notion.Client
2222
[JsonSubtypes.KnownSubType(typeof(RichTextProperty), PropertyType.RichText)]
2323
[JsonSubtypes.KnownSubType(typeof(RollupProperty), PropertyType.Rollup)]
2424
[JsonSubtypes.KnownSubType(typeof(SelectProperty), PropertyType.Select)]
25+
[JsonSubtypes.KnownSubType(typeof(StatusProperty), PropertyType.Status)]
2526
[JsonSubtypes.KnownSubType(typeof(TitleProperty), PropertyType.Title)]
2627
[JsonSubtypes.KnownSubType(typeof(UrlProperty), PropertyType.Url)]
2728
public class Property

Src/Notion.Client/Models/Database/Properties/PropertyType.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public enum PropertyType
6262
LastEditedBy,
6363

6464
[EnumMember(Value = "last_edited_time")]
65-
LastEditedTime
65+
LastEditedTime,
66+
67+
[EnumMember(Value = "status")]
68+
Status,
6669
}
6770
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Collections.Generic;
2+
using Newtonsoft.Json;
3+
4+
namespace Notion.Client
5+
{
6+
public class StatusProperty : Property
7+
{
8+
public override PropertyType Type => PropertyType.Status;
9+
10+
[JsonProperty("status")]
11+
public Dictionary<string, object> Status { get; set; }
12+
}
13+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Newtonsoft.Json;
4+
5+
namespace Notion.Client
6+
{
7+
public class TimestampCreatedTimeFilter : Filter
8+
{
9+
[JsonProperty("timestamp")]
10+
public string Timestamp = "created_time";
11+
12+
[JsonProperty("created_time")]
13+
public DateFilter.Condition CreatedTime { get; set; }
14+
15+
public TimestampCreatedTimeFilter(
16+
DateTime? equal = null,
17+
DateTime? before = null,
18+
DateTime? after = null,
19+
DateTime? onOrBefore = null,
20+
DateTime? onOrAfter = null,
21+
Dictionary<string, object> pastWeek = null,
22+
Dictionary<string, object> pastMonth = null,
23+
Dictionary<string, object> pastYear = null,
24+
Dictionary<string, object> nextWeek = null,
25+
Dictionary<string, object> nextMonth = null,
26+
Dictionary<string, object> nextYear = null,
27+
bool? isEmpty = null,
28+
bool? isNotEmpty = null)
29+
{
30+
CreatedTime = new DateFilter.Condition(
31+
equal: equal,
32+
before: before,
33+
after: after,
34+
onOrBefore: onOrBefore,
35+
onOrAfter: onOrAfter,
36+
pastWeek: pastWeek,
37+
pastMonth: pastMonth,
38+
pastYear: pastYear,
39+
nextWeek: nextWeek,
40+
nextMonth: nextMonth,
41+
nextYear: nextYear,
42+
isEmpty: isEmpty,
43+
isNotEmpty: isNotEmpty
44+
);
45+
}
46+
}
47+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Newtonsoft.Json;
4+
5+
namespace Notion.Client
6+
{
7+
public class TimestampLastEditedTimeFilter : Filter
8+
{
9+
[JsonProperty("timestamp")]
10+
public string Timestamp = "last_modified_time";
11+
12+
[JsonProperty("last_edited_time")]
13+
public DateFilter.Condition LastEditedTime { get; set; }
14+
15+
public TimestampLastEditedTimeFilter(
16+
DateTime? equal = null,
17+
DateTime? before = null,
18+
DateTime? after = null,
19+
DateTime? onOrBefore = null,
20+
DateTime? onOrAfter = null,
21+
Dictionary<string, object> pastWeek = null,
22+
Dictionary<string, object> pastMonth = null,
23+
Dictionary<string, object> pastYear = null,
24+
Dictionary<string, object> nextWeek = null,
25+
Dictionary<string, object> nextMonth = null,
26+
Dictionary<string, object> nextYear = null,
27+
bool? isEmpty = null,
28+
bool? isNotEmpty = null)
29+
{
30+
LastEditedTime = new DateFilter.Condition(
31+
equal: equal,
32+
before: before,
33+
after: after,
34+
onOrBefore: onOrBefore,
35+
onOrAfter: onOrAfter,
36+
pastWeek: pastWeek,
37+
pastMonth: pastMonth,
38+
pastYear: pastYear,
39+
nextWeek: nextWeek,
40+
nextMonth: nextMonth,
41+
nextYear: nextYear,
42+
isEmpty: isEmpty,
43+
isNotEmpty: isNotEmpty
44+
);
45+
}
46+
}
47+
}

0 commit comments

Comments
 (0)