2022-12-10 17:17:16 +00:00
|
|
|
package types
|
|
|
|
|
|
|
|
type CreatePost struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
Name string `json:"name" url:"name,omitempty"`
|
|
|
|
CommunityID int `json:"community_id" url:"community_id,omitempty"`
|
|
|
|
URL Optional[string] `json:"url" url:"url,omitempty"`
|
|
|
|
Body Optional[string] `json:"body" url:"body,omitempty"`
|
|
|
|
Honeypot Optional[string] `json:"honeypot" url:"honeypot,omitempty"`
|
|
|
|
NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"`
|
|
|
|
LanguageID Optional[int] `json:"language_id" url:"language_id,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type PostResponse struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
PostView PostView `json:"post_view" url:"post_view,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetPost struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
ID Optional[int] `json:"id" url:"id,omitempty"`
|
|
|
|
CommentID Optional[int] `json:"comment_id" url:"comment_id,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type GetPostResponse struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
PostView PostView `json:"post_view" url:"post_view,omitempty"`
|
|
|
|
CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"`
|
|
|
|
Moderators []CommunityModeratorView `json:"moderators" url:"moderators,omitempty"`
|
|
|
|
Online uint `json:"online" url:"online,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetPosts struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
Type Optional[ListingType] `json:"type" url:"type,omitempty"`
|
|
|
|
Sort Optional[SortType] `json:"sort" url:"sort,omitempty"`
|
|
|
|
Page Optional[int64] `json:"page" url:"page,omitempty"`
|
|
|
|
Limit Optional[int64] `json:"limit" url:"limit,omitempty"`
|
|
|
|
CommunityID Optional[int] `json:"community_id" url:"community_id,omitempty"`
|
|
|
|
CommunityName Optional[string] `json:"community_name" url:"community_name,omitempty"`
|
|
|
|
SavedOnly Optional[bool] `json:"saved_only" url:"saved_only,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type GetPostsResponse struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
Posts []PostView `json:"posts" url:"posts,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
type CreatePostLike struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
PostID int `json:"post_id" url:"post_id,omitempty"`
|
|
|
|
Score int16 `json:"score" url:"score,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type EditPost struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
PostID int `json:"post_id" url:"post_id,omitempty"`
|
|
|
|
Name Optional[string] `json:"name" url:"name,omitempty"`
|
|
|
|
URL Optional[string] `json:"url" url:"url,omitempty"`
|
|
|
|
Body Optional[string] `json:"body" url:"body,omitempty"`
|
|
|
|
NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"`
|
|
|
|
LanguageID Optional[int] `json:"language_id" url:"language_id,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type DeletePost struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
PostID int `json:"post_id" url:"post_id,omitempty"`
|
|
|
|
Deleted bool `json:"deleted" url:"deleted,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type RemovePost struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
PostID int `json:"post_id" url:"post_id,omitempty"`
|
|
|
|
Removed bool `json:"removed" url:"removed,omitempty"`
|
|
|
|
Reason Optional[string] `json:"reason" url:"reason,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type MarkPostAsRead struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
PostID int `json:"post_id" url:"post_id,omitempty"`
|
|
|
|
Read bool `json:"read" url:"read,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type LockPost struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
PostID int `json:"post_id" url:"post_id,omitempty"`
|
|
|
|
Locked bool `json:"locked" url:"locked,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type StickyPost struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
PostID int `json:"post_id" url:"post_id,omitempty"`
|
|
|
|
Stickied bool `json:"stickied" url:"stickied,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type SavePost struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
PostID int `json:"post_id" url:"post_id,omitempty"`
|
|
|
|
Save bool `json:"save" url:"save,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type CreatePostReport struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
PostID int `json:"post_id" url:"post_id,omitempty"`
|
|
|
|
Reason string `json:"reason" url:"reason,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type PostReportResponse struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
PostReportView PostReportView `json:"post_report_view" url:"post_report_view,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
type ResolvePostReport struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
ReportID int `json:"report_id" url:"report_id,omitempty"`
|
|
|
|
Resolved bool `json:"resolved" url:"resolved,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ListPostReports struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
Page Optional[int64] `json:"page" url:"page,omitempty"`
|
|
|
|
Limit Optional[int64] `json:"limit" url:"limit,omitempty"`
|
|
|
|
UnresolvedOnly Optional[bool] `json:"unresolved_only" url:"unresolved_only,omitempty"`
|
|
|
|
CommunityID Optional[int] `json:"community_id" url:"community_id,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ListPostReportsResponse struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
PostReports []PostReportView `json:"post_reports" url:"post_reports,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetSiteMetadata struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
URL string `json:"url" url:"url,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type GetSiteMetadataResponse struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
Metadata SiteMetadata `json:"metadata" url:"metadata,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
type SiteMetadata struct {
|
2022-12-10 23:33:08 +00:00
|
|
|
Title Optional[string] `json:"title" url:"title,omitempty"`
|
|
|
|
Description Optional[string] `json:"description" url:"description,omitempty"`
|
|
|
|
Image Optional[string] `json:"image" url:"image,omitempty"`
|
|
|
|
EmbedVideoURL Optional[string] `json:"embed_video_url" url:"embed_video_url,omitempty"`
|
2022-12-10 17:17:16 +00:00
|
|
|
}
|