go-mstdn/ent/status.go

50 lines
2.6 KiB
Go
Raw Normal View History

2023-09-26 11:35:08 +00:00
package ent
import (
2024-08-08 15:59:00 +00:00
gojson "encoding/json"
2023-09-26 11:35:08 +00:00
2024-08-08 15:59:00 +00:00
// "github.com/reiver/go-erorr"
"github.com/reiver/go-json"
"github.com/reiver/go-jsonint"
"github.com/reiver/go-opt"
"github.com/reiver/go-nul"
2023-09-26 11:35:08 +00:00
)
type Status struct {
ID opt.Optional[string] `json:"id"`
2024-08-08 15:59:00 +00:00
URI nul.Nullable[string] `json:"uri,omitempty"`
URL nul.Nullable[string] `json:"url,omitempty"`
CreatedAt opt.Optional[string] `json:"created_at,omitempty"`
Account Account `json:"account,omitempty"`
Content opt.Optional[string] `json:"content,omitempty"`
Visibility opt.Optional[string] `json:"visibility,omitempty"`
Sensitive opt.Optional[bool] `json:"sensitive,omitempty"`
SpoilerText opt.Optional[string] `json:"spoiler_text,omitempty"`
MediaAttachments []MediaAttachment `json:"media_attachments,omitempty"`
Application nul.Nullable[Application] `json:"application,omitempty"`
Mentions []Mention `json:"mentions,omitempty"`
Tags []Tag `json:"tags,omitempty"`
Emojis []CustomEmoji `json:"emojis,omitempty"`
ReblogsCount opt.Optional[jsonint.Int] `json:"reblogs_count,omitempty"`
FavouritesCount opt.Optional[jsonint.Int] `json:"favourites_count,omitempty"`
RepliesCount opt.Optional[jsonint.Int] `json:"replies_count,omitempty"`
InReplyToID nul.Nullable[string] `json:"in_reply_to_id,omitempty"`
InReplyToAccountID nul.Nullable[string] `json:"in_reply_to_account_id,omitempty"`
Reblog gojson.RawMessage `json:"reblog,omitempty"`
Poll nul.Nullable[Poll] `json:"poll,omitempty"`
Card nul.Nullable[PreviewCard] `json:"card,omitempty"`
Language nul.Nullable[string] `json:"language,omitempty"`
Text nul.Nullable[string] `json:"text,omitempty"`
EditedAt nul.Nullable[string] `json:"edited_at,omitempty"`
Favourited opt.Optional[bool] `json:"favourited,omitempty"`
Reblogged opt.Optional[bool] `json:"reblogged,omitempty"`
Muted opt.Optional[bool] `json:"muted,omitempty"`
Bookmarked opt.Optional[bool] `json:"bookmarked,omitempty"`
Pinned opt.Optional[bool] `json:"pinned,omitempty"`
Filtered gojson.RawMessage `json:"filtered,omitempty"`
2023-09-26 11:35:08 +00:00
}
2024-08-07 20:06:16 +00:00
func (receiver *Status) MarshalJSON() ([]byte, error) {
2024-08-08 15:59:00 +00:00
return json.Marshal(*receiver)
2024-08-07 20:06:16 +00:00
}