Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
namespace Notion.Client
using Newtonsoft.Json;

namespace Notion.Client
{
public class ParagraphUpdateBlock : IUpdateBlock
{
[JsonProperty("paragraph")]
public TextContentUpdate Paragraph { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
public class TextContentUpdate
{
[JsonProperty("text")]
public IEnumerable<RichTextBaseInput> Text { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class ToDoUpdateBlock : IUpdateBlock

public class Info
{
[JsonProperty("text")]
public IEnumerable<RichTextBaseInput> Text { get; set; }

[JsonProperty("checked")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
namespace Notion.Client
using Newtonsoft.Json;

namespace Notion.Client
{
public class ToggleUpdateBlock : IUpdateBlock
{
[JsonProperty("toggle")]
public TextContentUpdate Toggle { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
// TODO: need an input version of Block
public interface IBlocksAppendChildrenBodyParameters
{
[JsonProperty("children")]
IEnumerable<Block> Children { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
public interface IDatabasesCreateBodyParameters
{
[JsonProperty("parent")]
ParentPageInput Parent { get; set; }

[JsonProperty("properties")]
Dictionary<string, IPropertySchema> Properties { get; set; }

[JsonProperty("title")]
List<RichTextBaseInput> Title { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
namespace Notion.Client
using Newtonsoft.Json;

namespace Notion.Client
{
public class MentionInput
{
[JsonProperty("type")]
public string Type { get; set; }

[JsonProperty("user")]
public Person User { get; set; }

[JsonProperty("page")]
public ObjectId Page { get; set; }

[JsonProperty("database")]
public ObjectId Database { get; set; }

[JsonProperty("date")]
public DatePropertyValue Date { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
public class CheckboxPropertySchema : IPropertySchema
{
[JsonProperty("checkbox")]
public Dictionary<string, object> Checkbox { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
public class DatePropertySchema : IPropertySchema
{
[JsonProperty("date")]
public Dictionary<string, object> Date { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
public class EmailPropertySchema : IPropertySchema
{
[JsonProperty("email")]
public Dictionary<string, object> Email { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
public class FilePropertySchema : IPropertySchema
{
[JsonProperty("files")]
public Dictionary<string, object> Files { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
namespace Notion.Client
using Newtonsoft.Json;

namespace Notion.Client
{
public class FormulaPropertySchema : IPropertySchema
{
[JsonProperty("formula")]
public Formula Formula { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
namespace Notion.Client
using Newtonsoft.Json;

namespace Notion.Client
{
public class NumberPropertySchema : IPropertySchema
{
[JsonProperty("number")]
public Number Number { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
public class PeoplePropertySchema : IPropertySchema
{
[JsonProperty("people")]
public Dictionary<string, object> People { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ namespace Notion.Client
{
public class SelectOptionSchema
{
[JsonProperty("name")]
public string Name { get; set; }

[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
namespace Notion.Client
using Newtonsoft.Json;

namespace Notion.Client
{
public class SelectPropertySchema : IPropertySchema
{
[JsonProperty("select")]
public OptionWrapper<SelectOptionSchema> Select { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
public class TitlePropertySchema : IPropertySchema
{
[JsonProperty("title")]
public Dictionary<string, object> Title { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
public class URLPropertyScheam : IPropertySchema
{
[JsonProperty("url")]
public Dictionary<string, object> Url { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
namespace Notion.Client
using Newtonsoft.Json;

namespace Notion.Client
{
public class RichTextEquationInput : RichTextBaseInput
{
public override RichTextType Type => RichTextType.Equation;

[JsonProperty("equation")]
public Equation Equation { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
namespace Notion.Client
using Newtonsoft.Json;

namespace Notion.Client
{
public class RichTextMentionInput : RichTextBaseInput
{
public override RichTextType Type => RichTextType.Mention;

[JsonProperty("mention")]
public MentionInput Mention { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
namespace Notion.Client
using Newtonsoft.Json;

namespace Notion.Client
{
public class RichTextTextInput : RichTextBaseInput
{
public override RichTextType Type => RichTextType.Text;

[JsonProperty("text")]
public Text Text { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Notion.Client
{
public class FormulaUpdatePropertySchema : UpdatePropertySchema, IUpdatePropertySchema
{
[JsonProperty("checkbox")]
[JsonProperty("formula")]
public Formula Formula { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
public interface IDatabaseQueryBodyParameters : IPaginationParameters
{
[JsonProperty("filter")]
Filter Filter { get; set; }

[JsonProperty("sorts")]
List<Sort> Sorts { get; set; }
}
}
3 changes: 3 additions & 0 deletions Src/Notion.Client/Api/Databases/RequestParams/Sort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ namespace Notion.Client
{
public class Sort
{
[JsonProperty("property")]
public string Property { get; set; }

[JsonProperty("timestamp")]
[JsonConverter(typeof(StringEnumConverter))]
public Timestamp Timestamp { get; set; }

[JsonProperty("direction")]
[JsonConverter(typeof(StringEnumConverter))]
public Direction Direction { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
public interface IPagesUpdateBodyParameters
{
[JsonProperty("archived")]
bool Archived { get; set; }

[JsonProperty("properties")]
IDictionary<string, PropertyValue> Properties { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ namespace Notion.Client
{
public class PagesUpdateParameters : IPagesUpdateBodyParameters
{
[JsonProperty("archived")]
public bool Archived { get; set; }

[JsonProperty("properties")]
public IDictionary<string, PropertyValue> Properties { get; set; }

[JsonProperty("icon")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
namespace Notion.Client
using Newtonsoft.Json;

namespace Notion.Client
{
public interface ISearchBodyParameters : IPaginationParameters
{
[JsonProperty("query")]
string Query { get; set; }

[JsonProperty("sort")]
SearchSort Sort { get; set; }

[JsonProperty("filter")]
SearchFilter Filter { get; set; }
}
}
2 changes: 2 additions & 0 deletions Src/Notion.Client/Api/Search/Parameters/SearchSort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ namespace Notion.Client
{
public class SearchSort
{
[JsonProperty("direction")]
[JsonConverter(typeof(StringEnumConverter))]
public SearchDirection Direction { get; set; }

[JsonProperty("timestamp")]
public string Timestamp { get; set; }
}
}
1 change: 1 addition & 0 deletions Src/Notion.Client/Models/Blocks/Block.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class Block : IObject
public ObjectType Object => ObjectType.Block;
public string Id { get; set; }

[JsonProperty("type")]
[JsonConverter(typeof(StringEnumConverter))]
public virtual BlockType Type { get; set; }

Expand Down
3 changes: 3 additions & 0 deletions Src/Notion.Client/Models/Blocks/BulletedListItemBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ public class BulletedListItemBlock : Block

public class Info
{
[JsonProperty("text")]
public IEnumerable<RichTextBase> Text { get; set; }

[JsonProperty("children")]
public IEnumerable<Block> Children { get; set; }
}
}
Expand Down
1 change: 1 addition & 0 deletions Src/Notion.Client/Models/Blocks/ChildPageBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class ChildPageBlock : Block

public class Info
{
[JsonProperty("title")]
public string Title { get; set; }
}
}
Expand Down
Loading