diff --git a/.coverage b/.coverage index 7e7574f..0c7e8bc 100644 Binary files a/.coverage and b/.coverage differ diff --git a/src/mastodon/model/media.py b/src/mastodon/model/media.py new file mode 100644 index 0000000..3ff84d2 --- /dev/null +++ b/src/mastodon/model/media.py @@ -0,0 +1,26 @@ +from pydantic import BaseModel, Field + +class MetaData(BaseModel): + width: int + height: int + size: str + aspect: float + +class MetaCoordinates(BaseModel): + x: float + y: float + +class Meta(BaseModel): + original: MetaData + small: MetaData + focus: MetaCoordinates + +class MediaAttachment(BaseModel): + media_id: str = Field(alias="id") + media_type: str = Field(alias="type") + url: str + preview_url: str + text_url: str + meta: Meta + description: str + blurhash: str diff --git a/src/mastodon/model/status.py b/src/mastodon/model/status.py index 18ef4a3..114f828 100644 --- a/src/mastodon/model/status.py +++ b/src/mastodon/model/status.py @@ -4,6 +4,7 @@ from pydantic import BaseModel, Field from mastodon.model.application import Application from mastodon.model.account import Account from mastodon.model.card import Card +from mastodon.model.media import MediaAttachment from mastodon.model.poll import Poll @@ -29,7 +30,7 @@ class Status(BaseModel): reblog: Optional["Status"] # application: Optional[Application] account: Account - media_attachments: List + media_attachments: List[MediaAttachment] mentions: List tags: List emojis: List diff --git a/tests/resources/status.json b/tests/resources/status.json index c185982..b24ebca 100644 --- a/tests/resources/status.json +++ b/tests/resources/status.json @@ -48,32 +48,59 @@ "name": "Patreon", "value": "https://www.patreon.com/mastodonhttps://zeonfederated.comhttps://zeonfederated.com