linstrom/server/apiLinstromTypes.go

81 lines
4.3 KiB
Go

package server
// Contains types used by the Linstrom API. Types comply with the jsonapi spec
import "time"
type linstromNote struct {
Id string `jsonapi:"primary,notes"`
RawContent string `jsonapi:"attr,content"`
OriginServer *linstromOriginServer `jsonapi:"relation,origin_server"`
OriginServerId int `jsonapi:"attr,origin_server_id"`
ReactionCount string `jsonapi:"attr,reaction_count"`
CreatedAt time.Time `jsonapi:"attr,created_at"`
UpdatedAt *time.Time `jsonapi:"attr,updated_at,omitempty"`
Author *linstromAccount `jsonapi:"relation,author"`
AuthorId string `jsonapi:"attr,author_id"`
ContentWarning *string `jsonapi:"attr,content_warning,omitempty"`
InReplyToId *string `jsonapi:"attr,in_reply_to_id,omitempty"`
QuotesId *string `jsonapi:"attr,quotes_id,omitempty"`
EmoteIds []string `jsonapi:"attr,emotes,omitempty"`
Attachments []*linstromMediaMetadata `jsonapi:"relation,attachments,omitempty"`
AttachmentIds []string `jsonapi:"attr,attachment_ids"`
AccessLevel uint8 `jsonapi:"attr,access_level"`
Pings []*linstromAccount `jsonapi:"relation,pings,omitempty"`
PingIds []string `jsonapi:"attr,ping_ids,omitempty"`
}
type linstromOriginServer struct {
Id int `jsonapi:"primary,origins"`
CreatedAt time.Time `jsonapi:"attr,created_at"`
UpdatedAt *time.Time `jsonapi:"attr,updated_at,omitempty"`
ServerType string `jsonapi:"attr,server_type"` // one of "Linstrom", ""
Domain string `jsonapi:"attr,domain"`
DisplayName string `jsonapi:"attr,display_name"`
Icon *linstromMediaMetadata `jsonapi:"relation,icon"`
IsSelf bool `jsonapi:"attr,is_self"`
}
type linstromMediaMetadata struct {
Id string `jsonapi:"primary,medias"`
CreatedAt time.Time `jsonapi:"attr,created_at"`
UpdatedAt *time.Time `jsonapi:"attr,updated_at,omitempty"`
IsRemote bool `jsonapi:"attr,is_remote"`
Url string `jsonapi:"attr,url"`
MimeType string `jsonapi:"attr,mime_type"`
Name string `jsonapi:"attr,name"`
AltText string `jsonapi:"attr,alt_text"`
Blurred bool `jsonapi:"attr,blurred"`
}
type linstromAccount struct {
Id string `jsonapi:"primary,accounts"`
CreatedAt time.Time `jsonapi:"attr,created_at"`
UpdatedAt *time.Time `jsonapi:"attr,updated_at,omitempty"`
Username string `jsonapi:"attr,username"`
OriginServer *linstromOriginServer `jsonapi:"relation,origin_server"`
OriginServerId int `jsonapi:"attr,origin_server_id"`
DisplayName string `jsonapi:"attr,display_name"`
CustomFields []*linstromCustomAccountField `jsonapi:"relation,custom_fields"`
CustomFieldIds []uint `jsonapi:"attr,custom_field_ids"`
IsBot bool `jsonapi:"attr,is_bot"`
Description string `jsonapi:"attr,description"`
Icon *linstromMediaMetadata `jsonapi:"relation,icon"`
Banner *linstromMediaMetadata `jsonapi:"relation,banner"`
FollowerIds []string `jsonapi:"attr,follows_ids"`
FollowingIds []string `jsonapi:"attr,following_ids"`
Indexable bool `jsonapi:"attr,indexable"`
RestrictedFollow bool `jsonapi:"attr,restricted_follow"`
IdentifiesAs []string `jsonapi:"attr,identifies_as"`
Pronouns []string `jsonapi:"attr,pronouns"`
}
type linstromCustomAccountField struct {
Id uint
CreatedAt time.Time `jsonapi:"attr,created_at"`
UpdatedAt *time.Time `jsonapi:"attr,updated_at,omitempty"`
Key string `jsonapi:"attr,key"`
Value string `jsonapi:"attr,value"`
Verified *bool `jsonapi:"attr,verified,omitempty"`
BelongsToId string `jsonapi:"attr,belongs_to_id"`
}