chilp/api_typing
Module to match and type JSON data from the endpoints, I just typed these by hand, so if innacurate, they might bug out.
Types
pub type Account {
Account(
id: String,
username: String,
acct: String,
display_name: String,
locked: Bool,
bot: Bool,
discoverable: Bool,
indexable: Bool,
group: Bool,
created_at: String,
note: String,
url: String,
uri: String,
avatar: String,
avatar_static: String,
header: String,
header_static: String,
followers_count: Int,
following_count: Int,
statuses_count: Int,
last_status_at: String,
)
}
Constructors
-
Account( id: String, username: String, acct: String, display_name: String, locked: Bool, bot: Bool, discoverable: Bool, indexable: Bool, group: Bool, created_at: String, note: String, url: String, uri: String, avatar: String, avatar_static: String, header: String, header_static: String, followers_count: Int, following_count: Int, statuses_count: Int, last_status_at: String, )
pub type Mentions {
Mentions(
id: String,
username: String,
url: String,
acct: String,
)
}
Constructors
-
Mentions(id: String, username: String, url: String, acct: String)
A status, like the ones you get from urls like: https://pony.social/api/v1/statuses/115911235653686237/
pub type Status {
Status(
id: String,
created_at: String,
in_reply_to_id: String,
sensitive: Bool,
spoiler_text: String,
visibility: String,
language: String,
uri: String,
url: String,
replies_count: Int,
reblogs_count: Int,
favourites_count: Int,
quotes_count: Int,
edited_at: option.Option(String),
content: String,
account: Account,
media_attachments: List(String),
mentions: List(Mentions),
tags: List(StatusTag),
)
}
Constructors
-
Status( id: String, created_at: String, in_reply_to_id: String, sensitive: Bool, spoiler_text: String, visibility: String, language: String, uri: String, url: String, replies_count: Int, reblogs_count: Int, favourites_count: Int, quotes_count: Int, edited_at: option.Option(String), content: String, account: Account, media_attachments: List(String), mentions: List(Mentions), tags: List(StatusTag), )Arguments
- created_at
-
E.g. 2026-01-17T15:51:34.812Z
Values
pub fn account_decoder() -> decode.Decoder(Account)
pub fn status_context_decoder() -> decode.Decoder(StatusContext)
pub fn status_decoder() -> decode.Decoder(Status)