Skip to content

Commit 354c024

Browse files
author
SDKgen-Bot
committed
Operation "user.getAll.throws.999" was added
Operation "user.get.throws.999" was added Operation "database.get.throws.999" was added Operation "page.get.throws.999" was added Operation "page.create.throws.999" was added Type "Error" was added
1 parent 9000001 commit 354c024

22 files changed

+196
-2
lines changed

sdkgen.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"sdkfabric/notion":{"baseUrl":"https://api.notion.com","security":{"type":"httpBearer"},"operations":{"user.getAll":{"path":"/v1/users","method":"GET","return":{"code":200,"schema":{"$ref":"User_Collection"}},"arguments":{"Notion-Version":{"in":"header","schema":{"type":"string"}},"start_cursor":{"in":"query","schema":{"type":"string"}},"page_size":{"in":"query","schema":{"type":"integer"}}},"throws":[],"description":"Returns a paginated list of Users for the workspace. The response may contain fewer than page_size of results.","stability":1,"security":[],"authorization":true,"tags":[]},"user.get":{"path":"/v1/users/:user_id","method":"GET","return":{"code":200,"schema":{"$ref":"User"}},"arguments":{"Notion-Version":{"in":"header","schema":{"type":"string"}},"user_id":{"in":"path","schema":{"type":"string"}}},"throws":[],"description":"Retrieves a User using the ID specified.","stability":1,"security":[],"authorization":true,"tags":[]},"database.get":{"path":"/v1/databases/:database_id","method":"GET","return":{"code":200,"schema":{"$ref":"Database"}},"arguments":{"Notion-Version":{"in":"header","schema":{"type":"string"}},"database_id":{"in":"path","schema":{"type":"string"}}},"throws":[],"description":"Retrieves a database object \u2014 information that describes the structure and columns of a database \u2014 for a provided database ID. The response adheres to any limits to an integration\u2019s capabilities.","stability":1,"security":[],"authorization":true,"tags":[]},"page.get":{"path":"/v1/pages/:page_id","method":"GET","return":{"code":200,"schema":{"$ref":"Page"}},"arguments":{"page_id":{"in":"path","schema":{"type":"string"}}},"throws":[],"description":"Retrieves a Page object using the ID specified.","stability":1,"security":[],"authorization":true,"tags":[]},"page.create":{"path":"/v1/pages","method":"POST","return":{"code":200,"schema":{"$ref":"Page"}},"arguments":{"payload":{"in":"body","schema":{"$ref":"Page"}}},"throws":[],"description":"Creates a new page that is a child of an existing page or database.","stability":1,"security":[],"authorization":true,"tags":[]}},"definitions":{"Block":{"description":"","type":"object","properties":{"object":{"description":"","type":"string"},"id":{"description":"","type":"string"},"parent":{"description":"","$ref":"Page"},"created_time":{"description":"","format":"date-time","type":"string"},"last_edited_time":{"description":"","format":"date-time","type":"string"},"created_by":{"description":"","$ref":"User"},"last_edited_by":{"description":"","$ref":"User"},"has_children":{"description":"","type":"boolean"},"in_trash":{"description":"","type":"boolean"},"type":{"description":"","type":"string"}}},"Comment":{"description":"","type":"object","properties":{"parent":{"description":"","$ref":"Page_Id"},"discussion_id":{"description":"","type":"string"},"rich_text":{"description":"","$ref":"Rich_Text"}}},"Database":{"description":"","type":"object","properties":{"object":{"description":"","type":"string"},"id":{"description":"","type":"string"},"created_time":{"description":"","format":"date-time","type":"string"},"last_edited_time":{"description":"","format":"date-time","type":"string"},"icon":{"description":"","$ref":"Database_Icon"},"cover":{"description":"","$ref":"Database_Cover"},"url":{"description":"","type":"string"},"title":{"description":"","type":"array","items":{"$ref":"Database_Title"}},"description":{"description":"","type":"array","items":{"$ref":"Database_Title"}}}},"Database_Annotations":{"description":"","type":"object","properties":{"bold":{"description":"","type":"boolean"},"italic":{"description":"","type":"boolean"},"strikethrough":{"description":"","type":"boolean"},"underline":{"description":"","type":"boolean"},"code":{"description":"","type":"boolean"},"color":{"description":"","type":"string"}}},"Database_Cover":{"description":"","type":"object","properties":{"type":{"description":"","type":"string"},"external":{"description":"","type":"any"}}},"Database_Icon":{"description":"","type":"object","properties":{"type":{"description":"","type":"string"},"emoji":{"description":"","type":"string"}}},"Database_Id":{"description":"","type":"object","properties":{"database_id":{"description":"","type":"string"}}},"Database_Text":{"description":"","type":"object","properties":{"content":{"description":"","type":"string"},"link":{"description":"","type":"string"}}},"Database_Title":{"description":"","type":"object","properties":{"type":{"description":"","type":"string"},"text":{"description":"","type":"string"},"annotations":{"description":"","$ref":"Database_Annotations"},"plain_text":{"description":"","type":"string"},"href":{"description":"","type":"string"}}},"Page":{"description":"","type":"object","properties":{"object":{"description":"","type":"string"},"id":{"description":"","type":"string"},"created_time":{"description":"","format":"date-time","type":"string"},"last_edited_time":{"description":"","format":"date-time","type":"string"},"created_by":{"description":"","$ref":"User"},"last_edited_by":{"description":"","$ref":"User"},"cover":{"description":"","type":"string"},"icon":{"description":"","type":"string"},"parent":{"description":"","oneOf":[{"$ref":"Database_Id"},{"$ref":"Page_Id"}]},"in_trash":{"description":"","type":"boolean"},"properties":{"description":"","type":"object","additionalProperties":{"type":"any"}},"url":{"description":"","type":"string"},"public_url":{"description":"","type":"string"}}},"Page_Id":{"description":"","type":"object","properties":{"page_id":{"description":"","type":"string"}}},"Person":{"description":"","type":"object","properties":{"email":{"description":"","type":"string"}}},"Rich_Text":{"description":"","type":"object","properties":{"type":{"description":"","type":"string"},"annotations":{"description":"","$ref":"Rich_Text_Annotation"},"plain_text":{"description":"","type":"string"},"href":{"description":"","type":"string"}}},"Rich_Text_Annotation":{"description":"","type":"object","properties":{"bold":{"description":"","type":"boolean"},"italic":{"description":"","type":"boolean"},"strikethrough":{"description":"","type":"boolean"},"underline":{"description":"","type":"boolean"},"code":{"description":"","type":"boolean"},"color":{"description":"","type":"string"}}},"User":{"description":"","type":"object","properties":{"object":{"description":"","type":"string"},"id":{"description":"","type":"string"},"type":{"description":"","type":"string"},"person":{"description":"","$ref":"Person"},"name":{"description":"","type":"string"},"avatar_url":{"description":"","type":"string"}}},"User_Collection":{"description":"","type":"object","properties":{"results":{"description":"","type":"array","items":{"$ref":"User"}},"next_cursor":{"description":"","type":"string"},"has_more":{"description":"","type":"boolean"}}}}}}
1+
{"sdkfabric/notion":{"baseUrl":"https://api.notion.com","security":{"type":"httpBearer"},"operations":{"user.getAll":{"path":"/v1/users","method":"GET","return":{"code":200,"schema":{"type":"reference","target":"User_Collection"}},"arguments":{"Notion-Version":{"in":"header","schema":{"type":"string"}},"start_cursor":{"in":"query","schema":{"type":"string"}},"page_size":{"in":"query","schema":{"type":"integer"}}},"throws":[{"code":999,"schema":{"type":"reference","target":"Error"}}],"description":"Returns a paginated list of Users for the workspace. The response may contain fewer than page_size of results.","stability":1,"security":[],"authorization":true,"tags":[]},"user.get":{"path":"/v1/users/:user_id","method":"GET","return":{"code":200,"schema":{"type":"reference","target":"User"}},"arguments":{"Notion-Version":{"in":"header","schema":{"type":"string"}},"user_id":{"in":"path","schema":{"type":"string"}}},"throws":[{"code":999,"schema":{"type":"reference","target":"Error"}}],"description":"Retrieves a User using the ID specified.","stability":1,"security":[],"authorization":true,"tags":[]},"database.get":{"path":"/v1/databases/:database_id","method":"GET","return":{"code":200,"schema":{"type":"reference","target":"Database"}},"arguments":{"Notion-Version":{"in":"header","schema":{"type":"string"}},"database_id":{"in":"path","schema":{"type":"string"}}},"throws":[{"code":999,"schema":{"type":"reference","target":"Error"}}],"description":"Retrieves a database object \u2014 information that describes the structure and columns of a database \u2014 for a provided database ID. The response adheres to any limits to an integration\u2019s capabilities.","stability":1,"security":[],"authorization":true,"tags":[]},"page.get":{"path":"/v1/pages/:page_id","method":"GET","return":{"code":200,"schema":{"type":"reference","target":"Page"}},"arguments":{"page_id":{"in":"path","schema":{"type":"string"}}},"throws":[{"code":999,"schema":{"type":"reference","target":"Error"}}],"description":"Retrieves a Page object using the ID specified.","stability":1,"security":[],"authorization":true,"tags":[]},"page.create":{"path":"/v1/pages","method":"POST","return":{"code":200,"schema":{"type":"reference","target":"Page"}},"arguments":{"payload":{"in":"body","schema":{"type":"reference","target":"Page"}}},"throws":[{"code":999,"schema":{"type":"reference","target":"Error"}}],"description":"Creates a new page that is a child of an existing page or database.","stability":1,"security":[],"authorization":true,"tags":[]}},"definitions":{"Block":{"description":"","type":"struct","properties":{"object":{"description":"","type":"string"},"id":{"description":"","type":"string"},"parent":{"description":"","type":"reference","target":"Page"},"created_time":{"description":"","type":"string","format":"date-time"},"last_edited_time":{"description":"","type":"string","format":"date-time"},"created_by":{"description":"","type":"reference","target":"User"},"last_edited_by":{"description":"","type":"reference","target":"User"},"has_children":{"description":"","type":"boolean"},"in_trash":{"description":"","type":"boolean"},"type":{"description":"","type":"string"}}},"Comment":{"description":"","type":"struct","properties":{"parent":{"description":"","type":"reference","target":"Page_Id"},"discussion_id":{"description":"","type":"string"},"rich_text":{"description":"","type":"reference","target":"Rich_Text"}}},"Database":{"description":"","type":"struct","properties":{"object":{"description":"","type":"string"},"id":{"description":"","type":"string"},"created_time":{"description":"","type":"string","format":"date-time"},"last_edited_time":{"description":"","type":"string","format":"date-time"},"icon":{"description":"","type":"reference","target":"Database_Icon"},"cover":{"description":"","type":"reference","target":"Database_Cover"},"url":{"description":"","type":"string"},"title":{"description":"","type":"array","schema":{"type":"reference","target":"Database_Title"}},"description":{"description":"","type":"array","schema":{"type":"reference","target":"Database_Title"}}}},"Database_Annotations":{"description":"","type":"struct","properties":{"bold":{"description":"","type":"boolean"},"italic":{"description":"","type":"boolean"},"strikethrough":{"description":"","type":"boolean"},"underline":{"description":"","type":"boolean"},"code":{"description":"","type":"boolean"},"color":{"description":"","type":"string"}}},"Database_Cover":{"description":"","type":"struct","properties":{"type":{"description":"","type":"string"},"external":{"description":"","type":"any"}}},"Database_Icon":{"description":"","type":"struct","properties":{"type":{"description":"","type":"string"},"emoji":{"description":"","type":"string"}}},"Database_Id":{"description":"","type":"struct","properties":{"database_id":{"description":"","type":"string"}}},"Database_Text":{"description":"","type":"struct","properties":{"content":{"description":"","type":"string"},"link":{"description":"","type":"string"}}},"Database_Title":{"description":"","type":"struct","properties":{"type":{"description":"","type":"string"},"text":{"description":"","type":"string"},"annotations":{"description":"","type":"reference","target":"Database_Annotations"},"plain_text":{"description":"","type":"string"},"href":{"description":"","type":"string"}}},"Error":{"description":"","type":"struct","properties":{"code":{"description":"","type":"string"},"message":{"description":"","type":"string"}}},"Page":{"description":"","type":"struct","properties":{"object":{"description":"","type":"string"},"id":{"description":"","type":"string"},"created_time":{"description":"","type":"string","format":"date-time"},"last_edited_time":{"description":"","type":"string","format":"date-time"},"created_by":{"description":"","type":"reference","target":"User"},"last_edited_by":{"description":"","type":"reference","target":"User"},"cover":{"description":"","type":"string"},"icon":{"description":"","type":"string"},"parent":{"description":"","type":"any"},"in_trash":{"description":"","type":"boolean"},"properties":{"description":"","type":"map","schema":{"type":"any"}},"url":{"description":"","type":"string"},"public_url":{"description":"","type":"string"}}},"Page_Id":{"description":"","type":"struct","properties":{"page_id":{"description":"","type":"string"}}},"Person":{"description":"","type":"struct","properties":{"email":{"description":"","type":"string"}}},"Rich_Text":{"description":"","type":"struct","properties":{"type":{"description":"","type":"string"},"annotations":{"description":"","type":"reference","target":"Rich_Text_Annotation"},"plain_text":{"description":"","type":"string"},"href":{"description":"","type":"string"}}},"Rich_Text_Annotation":{"description":"","type":"struct","properties":{"bold":{"description":"","type":"boolean"},"italic":{"description":"","type":"boolean"},"strikethrough":{"description":"","type":"boolean"},"underline":{"description":"","type":"boolean"},"code":{"description":"","type":"boolean"},"color":{"description":"","type":"string"}}},"User":{"description":"","type":"struct","properties":{"object":{"description":"","type":"string"},"id":{"description":"","type":"string"},"type":{"description":"","type":"string"},"person":{"description":"","type":"reference","target":"Person"},"name":{"description":"","type":"string"},"avatar_url":{"description":"","type":"string"}}},"User_Collection":{"description":"","type":"struct","properties":{"results":{"description":"","type":"array","schema":{"type":"reference","target":"User"}},"next_cursor":{"description":"","type":"string"},"has_more":{"description":"","type":"boolean"}}}}}}

src/SdkFabric.Notion/Block.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,40 @@
44
*/
55

66
using System.Text.Json.Serialization;
7+
78
namespace SdkFabric.Notion;
9+
810
public class Block
911
{
1012
[JsonPropertyName("object")]
1113
public string? Object { get; set; }
14+
1215
[JsonPropertyName("id")]
1316
public string? Id { get; set; }
17+
1418
[JsonPropertyName("parent")]
1519
public Page? Parent { get; set; }
20+
1621
[JsonPropertyName("created_time")]
1722
public System.DateTime? CreatedTime { get; set; }
23+
1824
[JsonPropertyName("last_edited_time")]
1925
public System.DateTime? LastEditedTime { get; set; }
26+
2027
[JsonPropertyName("created_by")]
2128
public User? CreatedBy { get; set; }
29+
2230
[JsonPropertyName("last_edited_by")]
2331
public User? LastEditedBy { get; set; }
32+
2433
[JsonPropertyName("has_children")]
2534
public bool? HasChildren { get; set; }
35+
2636
[JsonPropertyName("in_trash")]
2737
public bool? InTrash { get; set; }
38+
2839
[JsonPropertyName("type")]
2940
public string? Type { get; set; }
41+
3042
}
43+

src/SdkFabric.Notion/Comment.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44
*/
55

66
using System.Text.Json.Serialization;
7+
78
namespace SdkFabric.Notion;
9+
810
public class Comment
911
{
1012
[JsonPropertyName("parent")]
1113
public PageId? Parent { get; set; }
14+
1215
[JsonPropertyName("discussion_id")]
1316
public string? DiscussionId { get; set; }
17+
1418
[JsonPropertyName("rich_text")]
1519
public RichText? RichText { get; set; }
20+
1621
}
22+

src/SdkFabric.Notion/Database.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,37 @@
44
*/
55

66
using System.Text.Json.Serialization;
7+
78
namespace SdkFabric.Notion;
9+
810
public class Database
911
{
1012
[JsonPropertyName("object")]
1113
public string? Object { get; set; }
14+
1215
[JsonPropertyName("id")]
1316
public string? Id { get; set; }
17+
1418
[JsonPropertyName("created_time")]
1519
public System.DateTime? CreatedTime { get; set; }
20+
1621
[JsonPropertyName("last_edited_time")]
1722
public System.DateTime? LastEditedTime { get; set; }
23+
1824
[JsonPropertyName("icon")]
1925
public DatabaseIcon? Icon { get; set; }
26+
2027
[JsonPropertyName("cover")]
2128
public DatabaseCover? Cover { get; set; }
29+
2230
[JsonPropertyName("url")]
2331
public string? Url { get; set; }
32+
2433
[JsonPropertyName("title")]
2534
public System.Collections.Generic.List<DatabaseTitle>? Title { get; set; }
35+
2636
[JsonPropertyName("description")]
2737
public System.Collections.Generic.List<DatabaseTitle>? Description { get; set; }
38+
2839
}
40+

src/SdkFabric.Notion/DatabaseAnnotations.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,28 @@
44
*/
55

66
using System.Text.Json.Serialization;
7+
78
namespace SdkFabric.Notion;
9+
810
public class DatabaseAnnotations
911
{
1012
[JsonPropertyName("bold")]
1113
public bool? Bold { get; set; }
14+
1215
[JsonPropertyName("italic")]
1316
public bool? Italic { get; set; }
17+
1418
[JsonPropertyName("strikethrough")]
1519
public bool? Strikethrough { get; set; }
20+
1621
[JsonPropertyName("underline")]
1722
public bool? Underline { get; set; }
23+
1824
[JsonPropertyName("code")]
1925
public bool? Code { get; set; }
26+
2027
[JsonPropertyName("color")]
2128
public string? Color { get; set; }
29+
2230
}
31+

src/SdkFabric.Notion/DatabaseCover.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44
*/
55

66
using System.Text.Json.Serialization;
7+
78
namespace SdkFabric.Notion;
9+
810
public class DatabaseCover
911
{
1012
[JsonPropertyName("type")]
1113
public string? Type { get; set; }
14+
1215
[JsonPropertyName("external")]
1316
public object? External { get; set; }
17+
1418
}
19+

src/SdkFabric.Notion/DatabaseIcon.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44
*/
55

66
using System.Text.Json.Serialization;
7+
78
namespace SdkFabric.Notion;
9+
810
public class DatabaseIcon
911
{
1012
[JsonPropertyName("type")]
1113
public string? Type { get; set; }
14+
1215
[JsonPropertyName("emoji")]
1316
public string? Emoji { get; set; }
17+
1418
}
19+

src/SdkFabric.Notion/DatabaseId.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
*/
55

66
using System.Text.Json.Serialization;
7+
78
namespace SdkFabric.Notion;
9+
810
public class DatabaseId
911
{
1012
[JsonPropertyName("database_id")]
1113
public string? DatabaseId { get; set; }
14+
1215
}
16+

src/SdkFabric.Notion/DatabaseTag.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ public async Task<Database> Get(string databaseId)
4545
}
4646

4747
var statusCode = (int) response.StatusCode;
48+
if (statusCode >= 0 && statusCode <= 999)
49+
{
50+
var data = this.Parser.Parse<Error>(response.Content);
51+
52+
throw new ErrorException(data);
53+
}
54+
4855
throw new UnknownStatusCodeException("The server returned an unknown status code: " + statusCode);
4956
}
5057

src/SdkFabric.Notion/DatabaseText.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44
*/
55

66
using System.Text.Json.Serialization;
7+
78
namespace SdkFabric.Notion;
9+
810
public class DatabaseText
911
{
1012
[JsonPropertyName("content")]
1113
public string? Content { get; set; }
14+
1215
[JsonPropertyName("link")]
1316
public string? Link { get; set; }
17+
1418
}
19+

0 commit comments

Comments
 (0)