From 9c7d72d4d6916ec2caa6931ca96e45d2cb82b1d4 Mon Sep 17 00:00:00 2001 From: JohGuentner <3506359+johguentner@users.noreply.github.com> Date: Sat, 11 Sep 2021 21:08:06 +0200 Subject: [PATCH 1/4] polish method name in Block + add Embed-Block - rename "fillContent" of Block to "fillRawContent", since it is filling the rawContent (no direct breaking change) - added EmbedBlock (retreive url + caption) --- src/Entities/Blocks/Block.php | 5 +-- src/Entities/Blocks/ChildPage.php | 5 +++ src/Entities/Blocks/Embed.php | 51 +++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 src/Entities/Blocks/Embed.php diff --git a/src/Entities/Blocks/Block.php b/src/Entities/Blocks/Block.php index c8a97f7..cc40ad0 100644 --- a/src/Entities/Blocks/Block.php +++ b/src/Entities/Blocks/Block.php @@ -69,7 +69,7 @@ protected function fillFromRaw(): void { $this->fillId(); $this->fillType(); - $this->fillContent(); + $this->fillRawContent(); $this->fillHasChildren(); $this->fillCreatedTime(); $this->fillLastEditedTime(); @@ -88,7 +88,7 @@ private function fillType(): void /** * */ - private function fillContent(): void + private function fillRawContent(): void { if (Arr::exists($this->responseData, $this->getType())) { $this->rawContent = $this->responseData[$this->getType()]; @@ -193,6 +193,7 @@ private static function mapTypeToClass(string $type): string case 'child_page': case 'paragraph': case 'to_do': + case 'embed': case 'toggle': $class = str_replace('_', '', ucwords($type, '_')); return "FiveamCode\\LaravelNotionApi\\Entities\\Blocks\\" . $class; diff --git a/src/Entities/Blocks/ChildPage.php b/src/Entities/Blocks/ChildPage.php index f1577ee..c7ef831 100644 --- a/src/Entities/Blocks/ChildPage.php +++ b/src/Entities/Blocks/ChildPage.php @@ -13,6 +13,11 @@ */ class ChildPage extends Block { + function __construct(array $responseData = null){ + $this->type = "child_page"; + parent::__construct($responseData); + } + /** * */ diff --git a/src/Entities/Blocks/Embed.php b/src/Entities/Blocks/Embed.php new file mode 100644 index 0000000..f8d46e1 --- /dev/null +++ b/src/Entities/Blocks/Embed.php @@ -0,0 +1,51 @@ +type = "embed"; + parent::__construct($responseData); + } + + /** + * + */ + protected function fillFromRaw(): void + { + parent::fillFromRaw(); + $this->fillContent(); + } + + /** + * + */ + protected function fillContent(): void + { + $this->url = $this->rawContent['url']; + $this->caption = new RichText($this->rawContent['caption']); + $this->content = $this->url; + } + + public function getUrl(){ + return $this->url; + } + + public function getCaption(){ + return $this->caption; + } +} From 86e37f9c0efc9c9db4d78f37f522350f3766c7b4 Mon Sep 17 00:00:00 2001 From: JohGuentner <3506359+johguentner@users.noreply.github.com> Date: Sat, 11 Sep 2021 21:30:41 +0200 Subject: [PATCH 2/4] add embed-creation and add tests for embed-block --- src/Entities/Blocks/Embed.php | 28 +++++++++++++++-- tests/EndpointBlocksTest.php | 17 ++++++++-- ...esponse_specific_supported_blocks_200.json | 31 +++++++++++++++++++ 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/src/Entities/Blocks/Embed.php b/src/Entities/Blocks/Embed.php index f8d46e1..78fa34e 100644 --- a/src/Entities/Blocks/Embed.php +++ b/src/Entities/Blocks/Embed.php @@ -17,7 +17,27 @@ class Embed extends Block private RichText $caption; private string $url = ""; - function __construct(array $responseData = null){ + public static function create(string $url, string $caption): Embed + { + $embed = new Embed(); + + $embed->rawContent = [ + 'url' => $url, + 'caption' => [ + [ + 'type' => 'text', + 'text' => [ + 'content' => $caption + ] + ] + ] + ]; + + return $embed; + } + + function __construct(array $responseData = null) + { $this->type = "embed"; parent::__construct($responseData); } @@ -41,11 +61,13 @@ protected function fillContent(): void $this->content = $this->url; } - public function getUrl(){ + public function getUrl() + { return $this->url; } - public function getCaption(){ + public function getCaption() + { return $this->caption; } } diff --git a/tests/EndpointBlocksTest.php b/tests/EndpointBlocksTest.php index 0b7cb18..93503cd 100644 --- a/tests/EndpointBlocksTest.php +++ b/tests/EndpointBlocksTest.php @@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Http; use FiveamCode\LaravelNotionApi\Entities\Blocks\Block; use FiveamCode\LaravelNotionApi\Entities\Blocks\BulletedListItem; +use FiveamCode\LaravelNotionApi\Entities\Blocks\Embed; use FiveamCode\LaravelNotionApi\Entities\Blocks\HeadingOne; use FiveamCode\LaravelNotionApi\Entities\Blocks\HeadingThree; use FiveamCode\LaravelNotionApi\Entities\Blocks\HeadingTwo; @@ -99,7 +100,7 @@ public function it_returns_block_collection_with_children_as_correct_instances() $blockChildrenCollection = $blockChildren->asCollection(); $this->assertContainsOnly(Block::class, $blockChildrenCollection); $this->assertIsIterable($blockChildrenCollection); - $this->assertCount(8, $blockChildrenCollection); + $this->assertCount(9, $blockChildrenCollection); # check paragraph $blockChild = $blockChildrenCollection[0]; @@ -156,6 +157,14 @@ public function it_returns_block_collection_with_children_as_correct_instances() $this->assertEquals('toggle', $blockChild->getType()); $this->assertFalse($blockChild->hasChildren()); $this->assertEquals('toggle_block', $blockChild->getContent()->getPlainText()); + + # check embed + $blockChild = $blockChildrenCollection[8]; + $this->assertInstanceOf(Embed::class, $blockChild); + $this->assertEquals('embed', $blockChild->getType()); + $this->assertFalse($blockChild->hasChildren()); + $this->assertEquals('Testcaption', $blockChild->getCaption()->getPlainText()); + $this->assertEquals('https://notion.so', $blockChild->getUrl()); } /** @test */ @@ -202,6 +211,7 @@ public function it_returns_parent_block_in_which_new_blocks_have_been_successful $numberedListItem = NumberedListItem::create("New TextBlock"); $toDo = ToDo::create("New TextBlock"); $toggle = Toggle::create(["New TextBlock"]); + $embed = Embed::create("https://5amco.de", "Testcaption"); $parentBlock = Notion::block('1d719dd1-563b-4387-b74f-20da92b827fb')->append($paragraph); $this->assertInstanceOf(Block::class, $parentBlock); @@ -227,8 +237,11 @@ public function it_returns_parent_block_in_which_new_blocks_have_been_successful $parentBlock = Notion::block('1d719dd1-563b-4387-b74f-20da92b827fb')->append($toggle); $this->assertInstanceOf(Block::class, $parentBlock); + $parentBlock = Notion::block('1d719dd1-563b-4387-b74f-20da92b827fb')->append($embed); + $this->assertInstanceOf(Block::class, $parentBlock); + - $parentBlock = Notion::block('1d719dd1-563b-4387-b74f-20da92b827fb')->append([$paragraph, $bulletedListItem, $headingOne, $headingTwo, $headingThree, $numberedListItem, $toDo, $toggle]); + $parentBlock = Notion::block('1d719dd1-563b-4387-b74f-20da92b827fb')->append([$paragraph, $bulletedListItem, $headingOne, $headingTwo, $headingThree, $numberedListItem, $toDo, $toggle, $embed]); $this->assertInstanceOf(Block::class, $parentBlock); } } diff --git a/tests/stubs/endpoints/blocks/response_specific_supported_blocks_200.json b/tests/stubs/endpoints/blocks/response_specific_supported_blocks_200.json index 54096f0..74f6a65 100644 --- a/tests/stubs/endpoints/blocks/response_specific_supported_blocks_200.json +++ b/tests/stubs/endpoints/blocks/response_specific_supported_blocks_200.json @@ -233,6 +233,37 @@ } ] } + }, + { + "object": "block", + "id": "1750f17f-d2bd-105a-bedc-c6b5808b98be", + "created_time": "2021-09-11T18:52:00.000Z", + "last_edited_time": "2021-09-11T19:01:00.000Z", + "has_children": false, + "archived": false, + "type": "embed", + "embed": { + "caption": [ + { + "type": "text", + "text": { + "content": "Testcaption", + "link": null + }, + "annotations": { + "bold": false, + "italic": false, + "strikethrough": false, + "underline": false, + "code": false, + "color": "default" + }, + "plain_text": "Testcaption", + "href": null + } + ], + "url": "https://notion.so" + } } ], "next_cursor": null, From dc294f7561f4c54febb0ac2db018c69b1614d317 Mon Sep 17 00:00:00 2001 From: JohGuentner <3506359+johguentner@users.noreply.github.com> Date: Sun, 12 Sep 2021 00:05:05 +0200 Subject: [PATCH 3/4] fill content of embed-block within create - this ensures the currect values within the class attributes --- src/Entities/Blocks/Embed.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Entities/Blocks/Embed.php b/src/Entities/Blocks/Embed.php index 78fa34e..8edaa8c 100644 --- a/src/Entities/Blocks/Embed.php +++ b/src/Entities/Blocks/Embed.php @@ -33,6 +33,8 @@ public static function create(string $url, string $caption): Embed ] ]; + $embed->fillContent(); + return $embed; } From 76a4298b71f6611170b5845000bf68f66344af40 Mon Sep 17 00:00:00 2001 From: JohGuentner <3506359+johguentner@users.noreply.github.com> Date: Sun, 12 Sep 2021 01:08:15 +0200 Subject: [PATCH 4/4] add new blocks (file, image, video, pdf) + polish - set up BaseFileBlock::class for file-related blocks (file, image, file, pdf) - implement Modifiable within embed and BaseFileBlock - mark caption as optional paramter in embed and BaseFileBlock with empty string as default - set up tests for all new blocks (creation and retreival) --- src/Entities/Blocks/BaseFileBlock.php | 79 ++++++++++ src/Entities/Blocks/Block.php | 11 +- src/Entities/Blocks/Embed.php | 5 +- src/Entities/Blocks/File.php | 30 ++++ src/Entities/Blocks/Image.php | 30 ++++ src/Entities/Blocks/Pdf.php | 30 ++++ src/Entities/Blocks/Video.php | 30 ++++ tests/EndpointBlocksTest.php | 55 ++++++- ...esponse_specific_supported_blocks_200.json | 136 ++++++++++++++++++ 9 files changed, 399 insertions(+), 7 deletions(-) create mode 100644 src/Entities/Blocks/BaseFileBlock.php create mode 100644 src/Entities/Blocks/File.php create mode 100644 src/Entities/Blocks/Image.php create mode 100644 src/Entities/Blocks/Pdf.php create mode 100644 src/Entities/Blocks/Video.php diff --git a/src/Entities/Blocks/BaseFileBlock.php b/src/Entities/Blocks/BaseFileBlock.php new file mode 100644 index 0000000..6f4f679 --- /dev/null +++ b/src/Entities/Blocks/BaseFileBlock.php @@ -0,0 +1,79 @@ +rawContent = [ + 'type' => 'external', + 'caption' => [ + [ + 'type' => 'text', + 'text' => [ + 'content' => $caption + ] + ] + ], + 'external' => [ + 'url' => $url, + ] + ]; + + $fileBlock->fillContent(); + + return $fileBlock; + } + + private string $hostingType = ""; + private string $url = ""; + private RichText $caption; + + + /** + * + */ + protected function fillFromRaw(): void + { + parent::fillFromRaw(); + $this->fillContent(); + } + + /** + * + */ + protected function fillContent(): void + { + $this->hostingType = $this->rawContent['type']; + $this->url = $this->rawContent[$this->hostingType]['url']; + $this->caption = new RichText($this->rawContent['caption']); + $this->content = $this->url; + } + + public function getUrl() + { + return $this->url; + } + + public function getHostingType() + { + return $this->hostingType; + } + + public function getCaption() + { + return $this->caption; + } +} diff --git a/src/Entities/Blocks/Block.php b/src/Entities/Blocks/Block.php index cc40ad0..4ec1be5 100644 --- a/src/Entities/Blocks/Block.php +++ b/src/Entities/Blocks/Block.php @@ -156,12 +156,13 @@ public function getContent() /** * @return string */ - public function asText() : string + public function asText(): string { return $this->text; } - public function setContent($content){ + public function setContent($content) + { $this->content = $content; } @@ -193,8 +194,12 @@ private static function mapTypeToClass(string $type): string case 'child_page': case 'paragraph': case 'to_do': - case 'embed': case 'toggle': + case 'embed': + case 'image': + case 'video': + case 'file': + case 'pdf': $class = str_replace('_', '', ucwords($type, '_')); return "FiveamCode\\LaravelNotionApi\\Entities\\Blocks\\" . $class; case 'heading_1': diff --git a/src/Entities/Blocks/Embed.php b/src/Entities/Blocks/Embed.php index 8edaa8c..8b0b859 100644 --- a/src/Entities/Blocks/Embed.php +++ b/src/Entities/Blocks/Embed.php @@ -3,6 +3,7 @@ namespace FiveamCode\LaravelNotionApi\Entities\Blocks; use DateTime; +use FiveamCode\LaravelNotionApi\Entities\Contracts\Modifiable; use Illuminate\Support\Arr; use FiveamCode\LaravelNotionApi\Entities\Entity; use FiveamCode\LaravelNotionApi\Entities\PropertyItems\RichText; @@ -12,12 +13,12 @@ * Class Paragraph * @package FiveamCode\LaravelNotionApi\Entities\Blocks */ -class Embed extends Block +class Embed extends Block implements Modifiable { private RichText $caption; private string $url = ""; - public static function create(string $url, string $caption): Embed + public static function create(string $url, string $caption = ""): Embed { $embed = new Embed(); diff --git a/src/Entities/Blocks/File.php b/src/Entities/Blocks/File.php new file mode 100644 index 0000000..238d19b --- /dev/null +++ b/src/Entities/Blocks/File.php @@ -0,0 +1,30 @@ +type = "file"; + parent::__construct($responseData); + } + +} diff --git a/src/Entities/Blocks/Image.php b/src/Entities/Blocks/Image.php new file mode 100644 index 0000000..84ff24b --- /dev/null +++ b/src/Entities/Blocks/Image.php @@ -0,0 +1,30 @@ +type = "image"; + parent::__construct($responseData); + } + +} diff --git a/src/Entities/Blocks/Pdf.php b/src/Entities/Blocks/Pdf.php new file mode 100644 index 0000000..2846e01 --- /dev/null +++ b/src/Entities/Blocks/Pdf.php @@ -0,0 +1,30 @@ +type = "pdf"; + parent::__construct($responseData); + } + +} diff --git a/src/Entities/Blocks/Video.php b/src/Entities/Blocks/Video.php new file mode 100644 index 0000000..4fdbb73 --- /dev/null +++ b/src/Entities/Blocks/Video.php @@ -0,0 +1,30 @@ +type = "video"; + parent::__construct($responseData); + } + +} diff --git a/tests/EndpointBlocksTest.php b/tests/EndpointBlocksTest.php index 93503cd..24e0497 100644 --- a/tests/EndpointBlocksTest.php +++ b/tests/EndpointBlocksTest.php @@ -7,13 +7,17 @@ use FiveamCode\LaravelNotionApi\Entities\Blocks\Block; use FiveamCode\LaravelNotionApi\Entities\Blocks\BulletedListItem; use FiveamCode\LaravelNotionApi\Entities\Blocks\Embed; +use FiveamCode\LaravelNotionApi\Entities\Blocks\File; use FiveamCode\LaravelNotionApi\Entities\Blocks\HeadingOne; use FiveamCode\LaravelNotionApi\Entities\Blocks\HeadingThree; use FiveamCode\LaravelNotionApi\Entities\Blocks\HeadingTwo; +use FiveamCode\LaravelNotionApi\Entities\Blocks\Image; use FiveamCode\LaravelNotionApi\Entities\Blocks\NumberedListItem; use FiveamCode\LaravelNotionApi\Entities\Blocks\Paragraph; +use FiveamCode\LaravelNotionApi\Entities\Blocks\Pdf; use FiveamCode\LaravelNotionApi\Entities\Blocks\ToDo; use FiveamCode\LaravelNotionApi\Entities\Blocks\Toggle; +use FiveamCode\LaravelNotionApi\Entities\Blocks\Video; use FiveamCode\LaravelNotionApi\Exceptions\NotionException; use FiveamCode\LaravelNotionApi\Exceptions\HandlingException; use FiveamCode\LaravelNotionApi\Entities\Collections\BlockCollection; @@ -100,7 +104,7 @@ public function it_returns_block_collection_with_children_as_correct_instances() $blockChildrenCollection = $blockChildren->asCollection(); $this->assertContainsOnly(Block::class, $blockChildrenCollection); $this->assertIsIterable($blockChildrenCollection); - $this->assertCount(9, $blockChildrenCollection); + $this->assertCount(13, $blockChildrenCollection); # check paragraph $blockChild = $blockChildrenCollection[0]; @@ -165,6 +169,42 @@ public function it_returns_block_collection_with_children_as_correct_instances() $this->assertFalse($blockChild->hasChildren()); $this->assertEquals('Testcaption', $blockChild->getCaption()->getPlainText()); $this->assertEquals('https://notion.so', $blockChild->getUrl()); + + # check image + $blockChild = $blockChildrenCollection[9]; + $this->assertInstanceOf(Image::class, $blockChild); + $this->assertEquals('image', $blockChild->getType()); + $this->assertFalse($blockChild->hasChildren()); + $this->assertEquals('test', $blockChild->getCaption()->getPlainText()); + $this->assertEquals('external', $blockChild->getHostingType()); + $this->assertEquals('https://images.unsplash.com/photo-1593642533144-3d62aa4783ec?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb', $blockChild->getUrl()); + + # check file + $blockChild = $blockChildrenCollection[10]; + $this->assertInstanceOf(File::class, $blockChild); + $this->assertEquals('file', $blockChild->getType()); + $this->assertFalse($blockChild->hasChildren()); + $this->assertEquals('TestCaption', $blockChild->getCaption()->getPlainText()); + $this->assertEquals('external', $blockChild->getHostingType()); + $this->assertEquals('https://images.unsplash.com/photo-1593642533144-3d62aa4783ec?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb', $blockChild->getUrl()); + + # check video + $blockChild = $blockChildrenCollection[11]; + $this->assertInstanceOf(Video::class, $blockChild); + $this->assertEquals('video', $blockChild->getType()); + $this->assertFalse($blockChild->hasChildren()); + $this->assertEquals('TestCaption', $blockChild->getCaption()->getPlainText()); + $this->assertEquals('external', $blockChild->getHostingType()); + $this->assertEquals('https://www.w3schools.com/html/mov_bbb.mp4', $blockChild->getUrl()); + + # check pdf + $blockChild = $blockChildrenCollection[12]; + $this->assertInstanceOf(Pdf::class, $blockChild); + $this->assertEquals('pdf', $blockChild->getType()); + $this->assertFalse($blockChild->hasChildren()); + $this->assertEquals('TestCaption', $blockChild->getCaption()->getPlainText()); + $this->assertEquals('external', $blockChild->getHostingType()); + $this->assertEquals('https://notion.so/testpdf.pdf', $blockChild->getUrl()); } /** @test */ @@ -212,6 +252,9 @@ public function it_returns_parent_block_in_which_new_blocks_have_been_successful $toDo = ToDo::create("New TextBlock"); $toggle = Toggle::create(["New TextBlock"]); $embed = Embed::create("https://5amco.de", "Testcaption"); + $image = Image::create("https://images.unsplash.com/photo-1593642533144-3d62aa4783ec?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb", "Testcaption"); + $video = Image::create("https://www.w3schools.com/html/mov_bbb.mp4", "TestCaption"); + $pdf = Image::create("https://notion.so/testpdf.pdf", "TestCaption"); $parentBlock = Notion::block('1d719dd1-563b-4387-b74f-20da92b827fb')->append($paragraph); $this->assertInstanceOf(Block::class, $parentBlock); @@ -240,8 +283,16 @@ public function it_returns_parent_block_in_which_new_blocks_have_been_successful $parentBlock = Notion::block('1d719dd1-563b-4387-b74f-20da92b827fb')->append($embed); $this->assertInstanceOf(Block::class, $parentBlock); + $parentBlock = Notion::block('1d719dd1-563b-4387-b74f-20da92b827fb')->append($image); + $this->assertInstanceOf(Block::class, $parentBlock); + + $parentBlock = Notion::block('1d719dd1-563b-4387-b74f-20da92b827fb')->append($video); + $this->assertInstanceOf(Block::class, $parentBlock); + + $parentBlock = Notion::block('1d719dd1-563b-4387-b74f-20da92b827fb')->append($pdf); + $this->assertInstanceOf(Block::class, $parentBlock); - $parentBlock = Notion::block('1d719dd1-563b-4387-b74f-20da92b827fb')->append([$paragraph, $bulletedListItem, $headingOne, $headingTwo, $headingThree, $numberedListItem, $toDo, $toggle, $embed]); + $parentBlock = Notion::block('1d719dd1-563b-4387-b74f-20da92b827fb')->append([$paragraph, $bulletedListItem, $headingOne, $headingTwo, $headingThree, $numberedListItem, $toDo, $toggle, $embed, $image, $video, $pdf]); $this->assertInstanceOf(Block::class, $parentBlock); } } diff --git a/tests/stubs/endpoints/blocks/response_specific_supported_blocks_200.json b/tests/stubs/endpoints/blocks/response_specific_supported_blocks_200.json index 74f6a65..2c743f1 100644 --- a/tests/stubs/endpoints/blocks/response_specific_supported_blocks_200.json +++ b/tests/stubs/endpoints/blocks/response_specific_supported_blocks_200.json @@ -264,6 +264,142 @@ ], "url": "https://notion.so" } + }, + { + "object": "block", + "id": "1a14a61f-0d09-45c2-b97b-07b209474ecf", + "created_time": "2021-09-11T22:18:00.000Z", + "last_edited_time": "2021-09-11T22:21:00.000Z", + "has_children": false, + "archived": false, + "type": "image", + "image": { + "caption": [ + { + "type": "text", + "text": { + "content": "test", + "link": null + }, + "annotations": { + "bold": false, + "italic": false, + "strikethrough": false, + "underline": false, + "code": false, + "color": "default" + }, + "plain_text": "test", + "href": null + } + ], + "type": "external", + "external": { + "url": "https://images.unsplash.com/photo-1593642533144-3d62aa4783ec?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb" + } + } + }, + { + "object": "block", + "id": "5e506978-6e1f-10c3-8374-63eaf27eaecc", + "created_time": "2021-09-11T22:38:00.000Z", + "last_edited_time": "2021-09-11T22:38:00.000Z", + "has_children": false, + "archived": false, + "type": "file", + "file": { + "caption": [ + { + "type": "text", + "text": { + "content": "TestCaption", + "link": null + }, + "annotations": { + "bold": false, + "italic": false, + "strikethrough": false, + "underline": false, + "code": false, + "color": "default" + }, + "plain_text": "TestCaption", + "href": null + } + ], + "type": "external", + "external": { + "url": "https://images.unsplash.com/photo-1593642533144-3d62aa4783ec?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb" + } + } + }, + { + "object": "block", + "id": "3762ce35-e825-19e0-b024-4f5e172cdfe2", + "created_time": "2021-09-11T23:00:00.000Z", + "last_edited_time": "2021-09-11T23:00:00.000Z", + "has_children": false, + "archived": false, + "type": "video", + "video": { + "caption": [ + { + "type": "text", + "text": { + "content": "TestCaption", + "link": null + }, + "annotations": { + "bold": false, + "italic": false, + "strikethrough": false, + "underline": false, + "code": false, + "color": "default" + }, + "plain_text": "TestCaption", + "href": null + } + ], + "type": "external", + "external": { + "url": "https://www.w3schools.com/html/mov_bbb.mp4" + } + } + }, + { + "object": "block", + "id": "51a8e0ef-570a-4e14-bc03-16db98ad45db", + "created_time": "2021-09-11T22:58:00.000Z", + "last_edited_time": "2021-09-11T22:58:00.000Z", + "has_children": false, + "archived": false, + "type": "pdf", + "pdf": { + "caption": [ + { + "type": "text", + "text": { + "content": "TestCaption", + "link": null + }, + "annotations": { + "bold": false, + "italic": false, + "strikethrough": false, + "underline": false, + "code": false, + "color": "default" + }, + "plain_text": "TestCaption", + "href": null + } + ], + "type": "external", + "external": { + "url": "https://notion.so/testpdf.pdf" + } + } } ], "next_cursor": null,