trait MapsAttachments

Constants

protected MAX_DOCUMENT_NAME_LENGTH

Methods

array
mapAttachments(Collection $attachments)

Map the given Hypervel attachments to Bedrock content blocks.

array
buildDocumentBlock(Document $document)

Build a Bedrock document content block.

array
buildImageBlock(Image $image, string $bytes)

Build a Bedrock image content block.

string|null
getDocumentFormat(Document $document)

Map a Document's MIME type to a Bedrock document format.

string
getDocumentName(Document $document)

Build a Bedrock-compliant document name.

string
getImageFormat(Image $image)

Map an Image's MIME type to a Bedrock image format.

Details

at line 33
protected array mapAttachments(Collection $attachments)

Map the given Hypervel attachments to Bedrock content blocks.

Parameters

Collection $attachments

Return Value

array

at line 81
protected array buildDocumentBlock(Document $document)

Build a Bedrock document content block.

Parameters

Document $document

Return Value

array

at line 105
protected array buildImageBlock(Image $image, string $bytes)

Build a Bedrock image content block.

Parameters

Image $image
string $bytes

Return Value

array

at line 120
protected string|null getDocumentFormat(Document $document)

Map a Document's MIME type to a Bedrock document format.

Parameters

Document $document

Return Value

string|null

at line 148
protected string getDocumentName(Document $document)

Build a Bedrock-compliant document name.

Bedrock limits names to 200 characters containing alphanumerics, whitespace, hyphens, parentheses, and square brackets. mapAttachments resolves duplicates.

Parameters

Document $document

Return Value

string

at line 164
protected string getImageFormat(Image $image)

Map an Image's MIME type to a Bedrock image format.

Bedrock supports JPEG, PNG, GIF, and WebP images.

Parameters

Image $image

Return Value

string

Exceptions

InvalidArgumentException