GitHub

API reference for File.

A file part. content streams it (once, as the body is read); content_effect collects it.

Attributes

AttributeTypeDescription
keystr
namestr
content_typestr
contentStream[bytes, MultipartError]
tagLiteral['File'] = 'File'
content_effectEffect[bytes, MultipartError]

Functions

__init__

__init__(key, name, content_type, content) -> None
ParameterTypeDescription
keystr
namestr
content_typestr
contentStream[bytes, MultipartError]

to_json

to_json() -> dict[str, object]

Returns dict[str, object]

def to_json(self) -> dict[str, object]:
    return {
        "_id": "@effect/platform/Multipart/Part",
        "_tag": "File",
        "key": self.key,
        "name": self.name,
        "contentType": self.content_type,
    }