generated from padok-team/yatas-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReportPage.go
65 lines (62 loc) · 1.48 KB
/
ReportPage.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package main
import (
"github.com/jomei/notionapi"
)
func createReportPageRequest(client *notionapi.Client, db_id string) notionapi.PageCreateRequest {
notionTitle := notionapi.Text{
Content: "Yatas report",
}
notionPageHeader := notionapi.Text{
Content: "YATAS !!",
}
notionPagetext := notionapi.Text{
Content: "This is an new YATAS report.",
}
pageYatasCreateRequest := notionapi.PageCreateRequest{
Parent: notionapi.Parent{
DatabaseID: notionapi.DatabaseID(db_id),
},
Properties: notionapi.Properties{
"Name": notionapi.TitleProperty{
Title: []notionapi.RichText{
{Text: ¬ionTitle},
},
},
},
Icon: ¬ionapi.Icon{
Type: `external`,
External: ¬ionapi.FileObject{
URL: "https://raw.githubusercontent.com/Thibaut-Padok/yatas-notion/main/docs/auditory.png",
},
},
Children: []notionapi.Block{
notionapi.Heading2Block{
BasicBlock: notionapi.BasicBlock{
Type: notionapi.BlockType("heading_2"),
Object: notionapi.ObjectType("block"),
},
Heading2: notionapi.Heading{
RichText: []notionapi.RichText{
{
Text: ¬ionPageHeader,
},
},
},
},
notionapi.ParagraphBlock{
BasicBlock: notionapi.BasicBlock{
Type: notionapi.BlockType("paragraph"),
Object: notionapi.ObjectType("block"),
},
Paragraph: notionapi.Paragraph{
RichText: []notionapi.RichText{
{
Text: ¬ionPagetext,
},
},
},
},
},
}
return pageYatasCreateRequest
}