Skip to content

Commit 905b134

Browse files
Add support to retrieve & append Audio block ✨
1 parent 6ef3a9a commit 905b134

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Notion.Client
4+
{
5+
public class AudioBlock : Block
6+
{
7+
public override BlockType Type => BlockType.Audio;
8+
9+
[JsonProperty("audio")]
10+
public FileObject Audio { get; set; }
11+
}
12+
}

Src/Notion.Client/Models/Blocks/Block.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Notion.Client
66
{
77
[JsonConverter(typeof(JsonSubtypes), "type")]
8+
[JsonSubtypes.KnownSubType(typeof(AudioBlock), BlockType.Audio)]
89
[JsonSubtypes.KnownSubType(typeof(BookmarkBlock), BlockType.Bookmark)]
910
[JsonSubtypes.KnownSubType(typeof(BulletedListItemBlock), BlockType.BulletedListItem)]
1011
[JsonSubtypes.KnownSubType(typeof(ChildPageBlock), BlockType.ChildPage)]

Src/Notion.Client/Models/Blocks/BlockType.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public enum BlockType
6464
[EnumMember(Value = "divider")]
6565
Divider,
6666

67+
[EnumMember(Value = "audio")]
68+
Audio,
69+
6770
[EnumMember(Value = "unsupported")]
6871
Unsupported
6972
}

0 commit comments

Comments
 (0)