diff --git a/cmd/gen/generator/routes.go b/cmd/gen/generator/routes.go index f76e6e6..0b15744 100644 --- a/cmd/gen/generator/routes.go +++ b/cmd/gen/generator/routes.go @@ -28,11 +28,11 @@ func (r *RoutesGenerator) Generate(routes []extractor.Route) error { ).Id(transformName(r.Name)).ParamsFunc(func(g *jen.Group) { g.Id("ctx").Qual("context", "Context") if r.ParamsName != "" { - g.Id("data").Qual("go.elara.ws/go-lemmy/types", r.ParamsName) + g.Id("data").Id(r.ParamsName) } }).ParamsFunc(func(g *jen.Group) { if r.ReturnName != "" { - g.Op("*").Qual("go.elara.ws/go-lemmy/types", r.ReturnName) + g.Op("*").Id(r.ReturnName) } g.Error() }).BlockFunc(func(g *jen.Group) { @@ -47,7 +47,7 @@ func (r *RoutesGenerator) Generate(routes []extractor.Route) error { returnName = "EmptyResponse" } - g.Id("resData").Op(":=").Op("&").Qual("go.elara.ws/go-lemmy/types", returnName).Block() + g.Id("resData").Op(":=").Op("&").Id(returnName).Block() funcName := "req" if r.Method == "GET" { diff --git a/cmd/gen/main.go b/cmd/gen/main.go index 4ac3097..2e1d8d8 100644 --- a/cmd/gen/main.go +++ b/cmd/gen/main.go @@ -27,18 +27,13 @@ func main() { routes, structs := e.Extract() - err = os.MkdirAll(filepath.Join(*outDir, "types"), 0o755) - if err != nil { - log.Fatal("Error creating types directory").Err(err).Send() - } - - otf, err := os.Create(filepath.Join(*outDir, "types/types.gen.go")) + otf, err := os.Create(filepath.Join(*outDir, "types.gen.go")) if err != nil { log.Fatal("Error creating types output file").Err(err).Send() } defer otf.Close() - err = generator.NewStruct(otf, "types").Generate(structs) + err = generator.NewStruct(otf, "lemmy").Generate(structs) if err != nil { log.Fatal("Error generating output routes file").Err(err).Send() } diff --git a/types/errors.go b/errors.go similarity index 97% rename from types/errors.go rename to errors.go index f8ec744..da11838 100644 --- a/types/errors.go +++ b/errors.go @@ -1,4 +1,4 @@ -package types +package lemmy import ( "fmt" diff --git a/examples/http/main.go b/examples/http/main.go index d13de96..90a44b2 100644 --- a/examples/http/main.go +++ b/examples/http/main.go @@ -4,7 +4,6 @@ import ( "context" "go.elara.ws/go-lemmy" - "go.elara.ws/go-lemmy/types" ) func main() { @@ -15,7 +14,7 @@ func main() { panic(err) } - err = c.ClientLogin(ctx, types.Login{ + err = c.ClientLogin(ctx, lemmy.Login{ UsernameOrEmail: "user@example.com", Password: `TestPwd`, }) @@ -23,8 +22,8 @@ func main() { panic(err) } - _, err = c.SaveUserSettings(ctx, types.SaveUserSettings{ - BotAccount: types.NewOptional(true), + _, err = c.SaveUserSettings(ctx, lemmy.SaveUserSettings{ + BotAccount: lemmy.NewOptional(true), }) if err != nil { panic(err) diff --git a/lemmy.go b/lemmy.go index 797efe5..75eae8d 100644 --- a/lemmy.go +++ b/lemmy.go @@ -9,7 +9,6 @@ import ( "net/url" "github.com/google/go-querystring/query" - "go.elara.ws/go-lemmy/types" ) // Client is a client for Lemmy's HTTP API @@ -36,7 +35,7 @@ func NewWithClient(baseURL string, client *http.Client) (*Client, error) { // ClientLogin logs in to Lemmy by calling the Lemmy endpoint, // and stores the returned token for use in future requests. -func (c *Client) ClientLogin(ctx context.Context, l types.Login) error { +func (c *Client) ClientLogin(ctx context.Context, l Login) error { lr, err := c.Login(ctx, l) if err != nil { return err @@ -132,14 +131,14 @@ func (c *Client) getReq(ctx context.Context, method string, path string, data, r } // resError returns an error if the the response contains an error -func resError(res *http.Response, lr types.LemmyResponse) error { +func resError(res *http.Response, lr LemmyResponse) error { if lr.Error.IsValid() { - return types.LemmyError{ + return LemmyError{ Code: res.StatusCode, ErrStr: lr.Error.MustValue(), } } else if res.StatusCode != http.StatusOK { - return types.HTTPError{ + return HTTPError{ Code: res.StatusCode, } } else { diff --git a/types/optional.go b/optional.go similarity index 83% rename from types/optional.go rename to optional.go index 36d2b27..4537eea 100644 --- a/types/optional.go +++ b/optional.go @@ -1,4 +1,4 @@ -package types +package lemmy import ( "bytes" @@ -20,11 +20,6 @@ func NewOptional[T any](v T) Optional[T] { return Optional[T]{value: &v} } -// NewOptionalPtr creates an optional with the value pointed to by v -func NewOptionalPtr[T any](v *T) Optional[T] { - return Optional[T]{value: v} -} - // NewOptionalNil creates a new nil optional value func NewOptionalNil[T any]() Optional[T] { return Optional[T]{} @@ -36,12 +31,6 @@ func (o Optional[T]) Set(v T) Optional[T] { return o } -// SetPtr sets the value of the optional to the value bointed to by v -func (o Optional[T]) SetPtr(v *T) Optional[T] { - o.value = v - return o -} - // SetNil sets the optional value to nil func (o Optional[T]) SetNil() Optional[T] { o.value = nil @@ -77,8 +66,8 @@ func (o Optional[T]) ValueOr(fallback T) T { return fallback } -// ValueOrEmpty returns the value inside the optional if it exists, or else it returns the zero value of T -func (o Optional[T]) ValueOrEmpty() T { +// ValueOrZero returns the value inside the optional if it exists, or else it returns the zero value of T +func (o Optional[T]) ValueOrZero() T { if o.value != nil { return *o.value } diff --git a/routes.gen.go b/routes.gen.go index 0205bb7..0be1106 100644 --- a/routes.gen.go +++ b/routes.gen.go @@ -2,14 +2,11 @@ package lemmy -import ( - "context" - types "go.elara.ws/go-lemmy/types" -) +import "context" // Add an admin to your site. -func (c *Client) AddAdmin(ctx context.Context, data types.AddAdmin) (*types.AddAdminResponse, error) { - resData := &types.AddAdminResponse{} +func (c *Client) AddAdmin(ctx context.Context, data AddAdmin) (*AddAdminResponse, error) { + resData := &AddAdminResponse{} res, err := c.req(ctx, "POST", "/admin/add", data, &resData) if err != nil { return nil, err @@ -22,8 +19,8 @@ func (c *Client) AddAdmin(ctx context.Context, data types.AddAdmin) (*types.AddA } // Add a moderator to your community. -func (c *Client) AddModToCommunity(ctx context.Context, data types.AddModToCommunity) (*types.AddModToCommunityResponse, error) { - resData := &types.AddModToCommunityResponse{} +func (c *Client) AddModToCommunity(ctx context.Context, data AddModToCommunity) (*AddModToCommunityResponse, error) { + resData := &AddModToCommunityResponse{} res, err := c.req(ctx, "POST", "/community/mod", data, &resData) if err != nil { return nil, err @@ -36,8 +33,8 @@ func (c *Client) AddModToCommunity(ctx context.Context, data types.AddModToCommu } // Approve a registration application -func (c *Client) ApproveRegistrationApplication(ctx context.Context, data types.ApproveRegistrationApplication) (*types.RegistrationApplicationResponse, error) { - resData := &types.RegistrationApplicationResponse{} +func (c *Client) ApproveRegistrationApplication(ctx context.Context, data ApproveRegistrationApplication) (*RegistrationApplicationResponse, error) { + resData := &RegistrationApplicationResponse{} res, err := c.req(ctx, "PUT", "/admin/registration_application/approve", data, &resData) if err != nil { return nil, err @@ -50,8 +47,8 @@ func (c *Client) ApproveRegistrationApplication(ctx context.Context, data types. } // Ban a user from a community. -func (c *Client) BanFromCommunity(ctx context.Context, data types.BanFromCommunity) (*types.BanFromCommunityResponse, error) { - resData := &types.BanFromCommunityResponse{} +func (c *Client) BanFromCommunity(ctx context.Context, data BanFromCommunity) (*BanFromCommunityResponse, error) { + resData := &BanFromCommunityResponse{} res, err := c.req(ctx, "POST", "/community/ban_user", data, &resData) if err != nil { return nil, err @@ -64,8 +61,8 @@ func (c *Client) BanFromCommunity(ctx context.Context, data types.BanFromCommuni } // Ban a person from your site. -func (c *Client) BanPerson(ctx context.Context, data types.BanPerson) (*types.BanPersonResponse, error) { - resData := &types.BanPersonResponse{} +func (c *Client) BanPerson(ctx context.Context, data BanPerson) (*BanPersonResponse, error) { + resData := &BanPersonResponse{} res, err := c.req(ctx, "POST", "/user/ban", data, &resData) if err != nil { return nil, err @@ -78,8 +75,8 @@ func (c *Client) BanPerson(ctx context.Context, data types.BanPerson) (*types.Ba } // Block a community. -func (c *Client) BlockCommunity(ctx context.Context, data types.BlockCommunity) (*types.BlockCommunityResponse, error) { - resData := &types.BlockCommunityResponse{} +func (c *Client) BlockCommunity(ctx context.Context, data BlockCommunity) (*BlockCommunityResponse, error) { + resData := &BlockCommunityResponse{} res, err := c.req(ctx, "POST", "/community/block", data, &resData) if err != nil { return nil, err @@ -92,8 +89,8 @@ func (c *Client) BlockCommunity(ctx context.Context, data types.BlockCommunity) } // Block an instance. -func (c *Client) BlockInstance(ctx context.Context, data types.BlockInstance) (*types.BlockInstanceResponse, error) { - resData := &types.BlockInstanceResponse{} +func (c *Client) BlockInstance(ctx context.Context, data BlockInstance) (*BlockInstanceResponse, error) { + resData := &BlockInstanceResponse{} res, err := c.req(ctx, "POST", "/site/block", data, &resData) if err != nil { return nil, err @@ -106,8 +103,8 @@ func (c *Client) BlockInstance(ctx context.Context, data types.BlockInstance) (* } // Block a person. -func (c *Client) BlockPerson(ctx context.Context, data types.BlockPerson) (*types.BlockPersonResponse, error) { - resData := &types.BlockPersonResponse{} +func (c *Client) BlockPerson(ctx context.Context, data BlockPerson) (*BlockPersonResponse, error) { + resData := &BlockPersonResponse{} res, err := c.req(ctx, "POST", "/user/block", data, &resData) if err != nil { return nil, err @@ -120,8 +117,8 @@ func (c *Client) BlockPerson(ctx context.Context, data types.BlockPerson) (*type } // Change your user password. -func (c *Client) ChangePassword(ctx context.Context, data types.ChangePassword) (*types.LoginResponse, error) { - resData := &types.LoginResponse{} +func (c *Client) ChangePassword(ctx context.Context, data ChangePassword) (*LoginResponse, error) { + resData := &LoginResponse{} res, err := c.req(ctx, "PUT", "/user/change_password", data, &resData) if err != nil { return nil, err @@ -134,8 +131,8 @@ func (c *Client) ChangePassword(ctx context.Context, data types.ChangePassword) } // Create a comment. -func (c *Client) CreateComment(ctx context.Context, data types.CreateComment) (*types.CommentResponse, error) { - resData := &types.CommentResponse{} +func (c *Client) CreateComment(ctx context.Context, data CreateComment) (*CommentResponse, error) { + resData := &CommentResponse{} res, err := c.req(ctx, "POST", "/comment", data, &resData) if err != nil { return nil, err @@ -148,8 +145,8 @@ func (c *Client) CreateComment(ctx context.Context, data types.CreateComment) (* } // Report a comment. -func (c *Client) CreateCommentReport(ctx context.Context, data types.CreateCommentReport) (*types.CommentReportResponse, error) { - resData := &types.CommentReportResponse{} +func (c *Client) CreateCommentReport(ctx context.Context, data CreateCommentReport) (*CommentReportResponse, error) { + resData := &CommentReportResponse{} res, err := c.req(ctx, "POST", "/comment/report", data, &resData) if err != nil { return nil, err @@ -162,8 +159,8 @@ func (c *Client) CreateCommentReport(ctx context.Context, data types.CreateComme } // Create a new community. -func (c *Client) CreateCommunity(ctx context.Context, data types.CreateCommunity) (*types.CommunityResponse, error) { - resData := &types.CommunityResponse{} +func (c *Client) CreateCommunity(ctx context.Context, data CreateCommunity) (*CommunityResponse, error) { + resData := &CommunityResponse{} res, err := c.req(ctx, "POST", "/community", data, &resData) if err != nil { return nil, err @@ -176,8 +173,8 @@ func (c *Client) CreateCommunity(ctx context.Context, data types.CreateCommunity } // Create a new custom emoji -func (c *Client) CreateCustomEmoji(ctx context.Context, data types.CreateCustomEmoji) (*types.CustomEmojiResponse, error) { - resData := &types.CustomEmojiResponse{} +func (c *Client) CreateCustomEmoji(ctx context.Context, data CreateCustomEmoji) (*CustomEmojiResponse, error) { + resData := &CustomEmojiResponse{} res, err := c.req(ctx, "POST", "/custom_emoji", data, &resData) if err != nil { return nil, err @@ -190,8 +187,8 @@ func (c *Client) CreateCustomEmoji(ctx context.Context, data types.CreateCustomE } // Create a post. -func (c *Client) CreatePost(ctx context.Context, data types.CreatePost) (*types.PostResponse, error) { - resData := &types.PostResponse{} +func (c *Client) CreatePost(ctx context.Context, data CreatePost) (*PostResponse, error) { + resData := &PostResponse{} res, err := c.req(ctx, "POST", "/post", data, &resData) if err != nil { return nil, err @@ -204,8 +201,8 @@ func (c *Client) CreatePost(ctx context.Context, data types.CreatePost) (*types. } // Report a post. -func (c *Client) CreatePostReport(ctx context.Context, data types.CreatePostReport) (*types.PostReportResponse, error) { - resData := &types.PostReportResponse{} +func (c *Client) CreatePostReport(ctx context.Context, data CreatePostReport) (*PostReportResponse, error) { + resData := &PostReportResponse{} res, err := c.req(ctx, "POST", "/post/report", data, &resData) if err != nil { return nil, err @@ -218,8 +215,8 @@ func (c *Client) CreatePostReport(ctx context.Context, data types.CreatePostRepo } // Create a private message. -func (c *Client) CreatePrivateMessage(ctx context.Context, data types.CreatePrivateMessage) (*types.PrivateMessageResponse, error) { - resData := &types.PrivateMessageResponse{} +func (c *Client) CreatePrivateMessage(ctx context.Context, data CreatePrivateMessage) (*PrivateMessageResponse, error) { + resData := &PrivateMessageResponse{} res, err := c.req(ctx, "POST", "/private_message", data, &resData) if err != nil { return nil, err @@ -232,8 +229,8 @@ func (c *Client) CreatePrivateMessage(ctx context.Context, data types.CreatePriv } // Create a report for a private message. -func (c *Client) CreatePrivateMessageReport(ctx context.Context, data types.CreatePrivateMessageReport) (*types.PrivateMessageReportResponse, error) { - resData := &types.PrivateMessageReportResponse{} +func (c *Client) CreatePrivateMessageReport(ctx context.Context, data CreatePrivateMessageReport) (*PrivateMessageReportResponse, error) { + resData := &PrivateMessageReportResponse{} res, err := c.req(ctx, "POST", "/private_message/report", data, &resData) if err != nil { return nil, err @@ -246,8 +243,8 @@ func (c *Client) CreatePrivateMessageReport(ctx context.Context, data types.Crea } // Create your site. -func (c *Client) CreateSite(ctx context.Context, data types.CreateSite) (*types.SiteResponse, error) { - resData := &types.SiteResponse{} +func (c *Client) CreateSite(ctx context.Context, data CreateSite) (*SiteResponse, error) { + resData := &SiteResponse{} res, err := c.req(ctx, "POST", "/site", data, &resData) if err != nil { return nil, err @@ -260,8 +257,8 @@ func (c *Client) CreateSite(ctx context.Context, data types.CreateSite) (*types. } // Delete your account. -func (c *Client) DeleteAccount(ctx context.Context, data types.DeleteAccount) error { - resData := &types.EmptyResponse{} +func (c *Client) DeleteAccount(ctx context.Context, data DeleteAccount) error { + resData := &EmptyResponse{} res, err := c.req(ctx, "POST", "/user/delete_account", data, &resData) if err != nil { return err @@ -274,8 +271,8 @@ func (c *Client) DeleteAccount(ctx context.Context, data types.DeleteAccount) er } // Delete a comment. -func (c *Client) DeleteComment(ctx context.Context, data types.DeleteComment) (*types.CommentResponse, error) { - resData := &types.CommentResponse{} +func (c *Client) DeleteComment(ctx context.Context, data DeleteComment) (*CommentResponse, error) { + resData := &CommentResponse{} res, err := c.req(ctx, "POST", "/comment/delete", data, &resData) if err != nil { return nil, err @@ -288,8 +285,8 @@ func (c *Client) DeleteComment(ctx context.Context, data types.DeleteComment) (* } // Delete a community. -func (c *Client) DeleteCommunity(ctx context.Context, data types.DeleteCommunity) (*types.CommunityResponse, error) { - resData := &types.CommunityResponse{} +func (c *Client) DeleteCommunity(ctx context.Context, data DeleteCommunity) (*CommunityResponse, error) { + resData := &CommunityResponse{} res, err := c.req(ctx, "POST", "/community/delete", data, &resData) if err != nil { return nil, err @@ -302,8 +299,8 @@ func (c *Client) DeleteCommunity(ctx context.Context, data types.DeleteCommunity } // Delete a custom emoji -func (c *Client) DeleteCustomEmoji(ctx context.Context, data types.DeleteCustomEmoji) (*types.DeleteCustomEmojiResponse, error) { - resData := &types.DeleteCustomEmojiResponse{} +func (c *Client) DeleteCustomEmoji(ctx context.Context, data DeleteCustomEmoji) (*DeleteCustomEmojiResponse, error) { + resData := &DeleteCustomEmojiResponse{} res, err := c.req(ctx, "POST", "/custom_emoji/delete", data, &resData) if err != nil { return nil, err @@ -316,8 +313,8 @@ func (c *Client) DeleteCustomEmoji(ctx context.Context, data types.DeleteCustomE } // Delete a post. -func (c *Client) DeletePost(ctx context.Context, data types.DeletePost) (*types.PostResponse, error) { - resData := &types.PostResponse{} +func (c *Client) DeletePost(ctx context.Context, data DeletePost) (*PostResponse, error) { + resData := &PostResponse{} res, err := c.req(ctx, "POST", "/post/delete", data, &resData) if err != nil { return nil, err @@ -330,8 +327,8 @@ func (c *Client) DeletePost(ctx context.Context, data types.DeletePost) (*types. } // Delete a private message. -func (c *Client) DeletePrivateMessage(ctx context.Context, data types.DeletePrivateMessage) (*types.PrivateMessageResponse, error) { - resData := &types.PrivateMessageResponse{} +func (c *Client) DeletePrivateMessage(ctx context.Context, data DeletePrivateMessage) (*PrivateMessageResponse, error) { + resData := &PrivateMessageResponse{} res, err := c.req(ctx, "POST", "/private_message/delete", data, &resData) if err != nil { return nil, err @@ -344,8 +341,8 @@ func (c *Client) DeletePrivateMessage(ctx context.Context, data types.DeletePriv } // Distinguishes a comment (speak as moderator) -func (c *Client) DistinguishComment(ctx context.Context, data types.DistinguishComment) (*types.CommentResponse, error) { - resData := &types.CommentResponse{} +func (c *Client) DistinguishComment(ctx context.Context, data DistinguishComment) (*CommentResponse, error) { + resData := &CommentResponse{} res, err := c.req(ctx, "POST", "/comment/distinguish", data, &resData) if err != nil { return nil, err @@ -358,8 +355,8 @@ func (c *Client) DistinguishComment(ctx context.Context, data types.DistinguishC } // Edit a comment. -func (c *Client) EditComment(ctx context.Context, data types.EditComment) (*types.CommentResponse, error) { - resData := &types.CommentResponse{} +func (c *Client) EditComment(ctx context.Context, data EditComment) (*CommentResponse, error) { + resData := &CommentResponse{} res, err := c.req(ctx, "PUT", "/comment", data, &resData) if err != nil { return nil, err @@ -372,8 +369,8 @@ func (c *Client) EditComment(ctx context.Context, data types.EditComment) (*type } // Edit a community. -func (c *Client) EditCommunity(ctx context.Context, data types.EditCommunity) (*types.CommunityResponse, error) { - resData := &types.CommunityResponse{} +func (c *Client) EditCommunity(ctx context.Context, data EditCommunity) (*CommunityResponse, error) { + resData := &CommunityResponse{} res, err := c.req(ctx, "PUT", "/community", data, &resData) if err != nil { return nil, err @@ -386,8 +383,8 @@ func (c *Client) EditCommunity(ctx context.Context, data types.EditCommunity) (* } // Edit an existing custom emoji -func (c *Client) EditCustomEmoji(ctx context.Context, data types.EditCustomEmoji) (*types.CustomEmojiResponse, error) { - resData := &types.CustomEmojiResponse{} +func (c *Client) EditCustomEmoji(ctx context.Context, data EditCustomEmoji) (*CustomEmojiResponse, error) { + resData := &CustomEmojiResponse{} res, err := c.req(ctx, "PUT", "/custom_emoji", data, &resData) if err != nil { return nil, err @@ -400,8 +397,8 @@ func (c *Client) EditCustomEmoji(ctx context.Context, data types.EditCustomEmoji } // Edit a post. -func (c *Client) EditPost(ctx context.Context, data types.EditPost) (*types.PostResponse, error) { - resData := &types.PostResponse{} +func (c *Client) EditPost(ctx context.Context, data EditPost) (*PostResponse, error) { + resData := &PostResponse{} res, err := c.req(ctx, "PUT", "/post", data, &resData) if err != nil { return nil, err @@ -414,8 +411,8 @@ func (c *Client) EditPost(ctx context.Context, data types.EditPost) (*types.Post } // Edit a private message. -func (c *Client) EditPrivateMessage(ctx context.Context, data types.EditPrivateMessage) (*types.PrivateMessageResponse, error) { - resData := &types.PrivateMessageResponse{} +func (c *Client) EditPrivateMessage(ctx context.Context, data EditPrivateMessage) (*PrivateMessageResponse, error) { + resData := &PrivateMessageResponse{} res, err := c.req(ctx, "PUT", "/private_message", data, &resData) if err != nil { return nil, err @@ -428,8 +425,8 @@ func (c *Client) EditPrivateMessage(ctx context.Context, data types.EditPrivateM } // Edit your site. -func (c *Client) EditSite(ctx context.Context, data types.EditSite) (*types.SiteResponse, error) { - resData := &types.SiteResponse{} +func (c *Client) EditSite(ctx context.Context, data EditSite) (*SiteResponse, error) { + resData := &SiteResponse{} res, err := c.req(ctx, "PUT", "/site", data, &resData) if err != nil { return nil, err @@ -442,8 +439,8 @@ func (c *Client) EditSite(ctx context.Context, data types.EditSite) (*types.Site } // A moderator can feature a community post ( IE stick it to the top of a community ). -func (c *Client) FeaturePost(ctx context.Context, data types.FeaturePost) (*types.PostResponse, error) { - resData := &types.PostResponse{} +func (c *Client) FeaturePost(ctx context.Context, data FeaturePost) (*PostResponse, error) { + resData := &PostResponse{} res, err := c.req(ctx, "POST", "/post/feature", data, &resData) if err != nil { return nil, err @@ -456,8 +453,8 @@ func (c *Client) FeaturePost(ctx context.Context, data types.FeaturePost) (*type } // Follow / subscribe to a community. -func (c *Client) FollowCommunity(ctx context.Context, data types.FollowCommunity) (*types.CommunityResponse, error) { - resData := &types.CommunityResponse{} +func (c *Client) FollowCommunity(ctx context.Context, data FollowCommunity) (*CommunityResponse, error) { + resData := &CommunityResponse{} res, err := c.req(ctx, "POST", "/community/follow", data, &resData) if err != nil { return nil, err @@ -470,8 +467,8 @@ func (c *Client) FollowCommunity(ctx context.Context, data types.FollowCommunity } // Get a list of banned users -func (c *Client) BannedPersons(ctx context.Context) (*types.BannedPersonsResponse, error) { - resData := &types.BannedPersonsResponse{} +func (c *Client) BannedPersons(ctx context.Context) (*BannedPersonsResponse, error) { + resData := &BannedPersonsResponse{} res, err := c.getReq(ctx, "GET", "/user/banned", nil, &resData) if err != nil { return nil, err @@ -484,8 +481,8 @@ func (c *Client) BannedPersons(ctx context.Context) (*types.BannedPersonsRespons } // Fetch a Captcha. -func (c *Client) Captcha(ctx context.Context) (*types.GetCaptchaResponse, error) { - resData := &types.GetCaptchaResponse{} +func (c *Client) Captcha(ctx context.Context) (*GetCaptchaResponse, error) { + resData := &GetCaptchaResponse{} res, err := c.getReq(ctx, "GET", "/user/get_captcha", nil, &resData) if err != nil { return nil, err @@ -498,8 +495,8 @@ func (c *Client) Captcha(ctx context.Context) (*types.GetCaptchaResponse, error) } // Get / fetch comment. -func (c *Client) Comment(ctx context.Context, data types.GetComment) (*types.CommentResponse, error) { - resData := &types.CommentResponse{} +func (c *Client) Comment(ctx context.Context, data GetComment) (*CommentResponse, error) { + resData := &CommentResponse{} res, err := c.getReq(ctx, "GET", "/comment", data, &resData) if err != nil { return nil, err @@ -512,8 +509,8 @@ func (c *Client) Comment(ctx context.Context, data types.GetComment) (*types.Com } // Get / fetch comments. -func (c *Client) Comments(ctx context.Context, data types.GetComments) (*types.GetCommentsResponse, error) { - resData := &types.GetCommentsResponse{} +func (c *Client) Comments(ctx context.Context, data GetComments) (*GetCommentsResponse, error) { + resData := &GetCommentsResponse{} res, err := c.getReq(ctx, "GET", "/comment/list", data, &resData) if err != nil { return nil, err @@ -526,8 +523,8 @@ func (c *Client) Comments(ctx context.Context, data types.GetComments) (*types.G } // Get / fetch a community. -func (c *Client) Community(ctx context.Context, data types.GetCommunity) (*types.GetCommunityResponse, error) { - resData := &types.GetCommunityResponse{} +func (c *Client) Community(ctx context.Context, data GetCommunity) (*GetCommunityResponse, error) { + resData := &GetCommunityResponse{} res, err := c.getReq(ctx, "GET", "/community", data, &resData) if err != nil { return nil, err @@ -540,8 +537,8 @@ func (c *Client) Community(ctx context.Context, data types.GetCommunity) (*types } // Fetch federated instances. -func (c *Client) FederatedInstances(ctx context.Context) (*types.GetFederatedInstancesResponse, error) { - resData := &types.GetFederatedInstancesResponse{} +func (c *Client) FederatedInstances(ctx context.Context) (*GetFederatedInstancesResponse, error) { + resData := &GetFederatedInstancesResponse{} res, err := c.getReq(ctx, "GET", "/federated_instances", nil, &resData) if err != nil { return nil, err @@ -554,8 +551,8 @@ func (c *Client) FederatedInstances(ctx context.Context) (*types.GetFederatedIns } // Get the modlog. -func (c *Client) Modlog(ctx context.Context, data types.GetModlog) (*types.GetModlogResponse, error) { - resData := &types.GetModlogResponse{} +func (c *Client) Modlog(ctx context.Context, data GetModlog) (*GetModlogResponse, error) { + resData := &GetModlogResponse{} res, err := c.getReq(ctx, "GET", "/modlog", data, &resData) if err != nil { return nil, err @@ -568,8 +565,8 @@ func (c *Client) Modlog(ctx context.Context, data types.GetModlog) (*types.GetMo } // Get the details for a person. -func (c *Client) PersonDetails(ctx context.Context, data types.GetPersonDetails) (*types.GetPersonDetailsResponse, error) { - resData := &types.GetPersonDetailsResponse{} +func (c *Client) PersonDetails(ctx context.Context, data GetPersonDetails) (*GetPersonDetailsResponse, error) { + resData := &GetPersonDetailsResponse{} res, err := c.getReq(ctx, "GET", "/user", data, &resData) if err != nil { return nil, err @@ -582,8 +579,8 @@ func (c *Client) PersonDetails(ctx context.Context, data types.GetPersonDetails) } // Get mentions for your user. -func (c *Client) PersonMentions(ctx context.Context, data types.GetPersonMentions) (*types.GetPersonMentionsResponse, error) { - resData := &types.GetPersonMentionsResponse{} +func (c *Client) PersonMentions(ctx context.Context, data GetPersonMentions) (*GetPersonMentionsResponse, error) { + resData := &GetPersonMentionsResponse{} res, err := c.getReq(ctx, "GET", "/user/mention", data, &resData) if err != nil { return nil, err @@ -596,8 +593,8 @@ func (c *Client) PersonMentions(ctx context.Context, data types.GetPersonMention } // Get / fetch a post. -func (c *Client) Post(ctx context.Context, data types.GetPost) (*types.GetPostResponse, error) { - resData := &types.GetPostResponse{} +func (c *Client) Post(ctx context.Context, data GetPost) (*GetPostResponse, error) { + resData := &GetPostResponse{} res, err := c.getReq(ctx, "GET", "/post", data, &resData) if err != nil { return nil, err @@ -610,8 +607,8 @@ func (c *Client) Post(ctx context.Context, data types.GetPost) (*types.GetPostRe } // Get / fetch posts, with various filters. -func (c *Client) Posts(ctx context.Context, data types.GetPosts) (*types.GetPostsResponse, error) { - resData := &types.GetPostsResponse{} +func (c *Client) Posts(ctx context.Context, data GetPosts) (*GetPostsResponse, error) { + resData := &GetPostsResponse{} res, err := c.getReq(ctx, "GET", "/post/list", data, &resData) if err != nil { return nil, err @@ -624,8 +621,8 @@ func (c *Client) Posts(ctx context.Context, data types.GetPosts) (*types.GetPost } // Get / fetch private messages. -func (c *Client) PrivateMessages(ctx context.Context, data types.GetPrivateMessages) (*types.PrivateMessagesResponse, error) { - resData := &types.PrivateMessagesResponse{} +func (c *Client) PrivateMessages(ctx context.Context, data GetPrivateMessages) (*PrivateMessagesResponse, error) { + resData := &PrivateMessagesResponse{} res, err := c.getReq(ctx, "GET", "/private_message/list", data, &resData) if err != nil { return nil, err @@ -638,8 +635,8 @@ func (c *Client) PrivateMessages(ctx context.Context, data types.GetPrivateMessa } // Get comment replies. -func (c *Client) Replies(ctx context.Context, data types.GetReplies) (*types.GetRepliesResponse, error) { - resData := &types.GetRepliesResponse{} +func (c *Client) Replies(ctx context.Context, data GetReplies) (*GetRepliesResponse, error) { + resData := &GetRepliesResponse{} res, err := c.getReq(ctx, "GET", "/user/replies", data, &resData) if err != nil { return nil, err @@ -652,8 +649,8 @@ func (c *Client) Replies(ctx context.Context, data types.GetReplies) (*types.Get } // Get counts for your reports -func (c *Client) ReportCount(ctx context.Context, data types.GetReportCount) (*types.GetReportCountResponse, error) { - resData := &types.GetReportCountResponse{} +func (c *Client) ReportCount(ctx context.Context, data GetReportCount) (*GetReportCountResponse, error) { + resData := &GetReportCountResponse{} res, err := c.getReq(ctx, "GET", "/user/report_count", data, &resData) if err != nil { return nil, err @@ -666,8 +663,8 @@ func (c *Client) ReportCount(ctx context.Context, data types.GetReportCount) (*t } // Gets the site, and your user data. -func (c *Client) Site(ctx context.Context) (*types.GetSiteResponse, error) { - resData := &types.GetSiteResponse{} +func (c *Client) Site(ctx context.Context) (*GetSiteResponse, error) { + resData := &GetSiteResponse{} res, err := c.getReq(ctx, "GET", "/site", nil, &resData) if err != nil { return nil, err @@ -680,8 +677,8 @@ func (c *Client) Site(ctx context.Context) (*types.GetSiteResponse, error) { } // Fetch metadata for any given site. -func (c *Client) SiteMetadata(ctx context.Context, data types.GetSiteMetadata) (*types.GetSiteMetadataResponse, error) { - resData := &types.GetSiteMetadataResponse{} +func (c *Client) SiteMetadata(ctx context.Context, data GetSiteMetadata) (*GetSiteMetadataResponse, error) { + resData := &GetSiteMetadataResponse{} res, err := c.getReq(ctx, "GET", "/post/site_metadata", data, &resData) if err != nil { return nil, err @@ -694,8 +691,8 @@ func (c *Client) SiteMetadata(ctx context.Context, data types.GetSiteMetadata) ( } // Get your unread counts -func (c *Client) UnreadCount(ctx context.Context) (*types.GetUnreadCountResponse, error) { - resData := &types.GetUnreadCountResponse{} +func (c *Client) UnreadCount(ctx context.Context) (*GetUnreadCountResponse, error) { + resData := &GetUnreadCountResponse{} res, err := c.getReq(ctx, "GET", "/user/unread_count", nil, &resData) if err != nil { return nil, err @@ -708,8 +705,8 @@ func (c *Client) UnreadCount(ctx context.Context) (*types.GetUnreadCountResponse } // Get the unread registration applications count. -func (c *Client) UnreadRegistrationApplicationCount(ctx context.Context) (*types.GetUnreadRegistrationApplicationCountResponse, error) { - resData := &types.GetUnreadRegistrationApplicationCountResponse{} +func (c *Client) UnreadRegistrationApplicationCount(ctx context.Context) (*GetUnreadRegistrationApplicationCountResponse, error) { + resData := &GetUnreadRegistrationApplicationCountResponse{} res, err := c.getReq(ctx, "GET", "/admin/registration_application/count", nil, &resData) if err != nil { return nil, err @@ -722,8 +719,8 @@ func (c *Client) UnreadRegistrationApplicationCount(ctx context.Context) (*types } // Hide a community from public view. -func (c *Client) HideCommunity(ctx context.Context, data types.HideCommunity) (*types.CommunityResponse, error) { - resData := &types.CommunityResponse{} +func (c *Client) HideCommunity(ctx context.Context, data HideCommunity) (*CommunityResponse, error) { + resData := &CommunityResponse{} res, err := c.req(ctx, "PUT", "/community/hide", data, &resData) if err != nil { return nil, err @@ -736,8 +733,8 @@ func (c *Client) HideCommunity(ctx context.Context, data types.HideCommunity) (* } // Leave the Site admins. -func (c *Client) LeaveAdmin(ctx context.Context) (*types.GetSiteResponse, error) { - resData := &types.GetSiteResponse{} +func (c *Client) LeaveAdmin(ctx context.Context) (*GetSiteResponse, error) { + resData := &GetSiteResponse{} res, err := c.req(ctx, "POST", "/user/leave_admin", nil, &resData) if err != nil { return nil, err @@ -750,8 +747,8 @@ func (c *Client) LeaveAdmin(ctx context.Context) (*types.GetSiteResponse, error) } // Like / vote on a comment. -func (c *Client) LikeComment(ctx context.Context, data types.CreateCommentLike) (*types.CommentResponse, error) { - resData := &types.CommentResponse{} +func (c *Client) LikeComment(ctx context.Context, data CreateCommentLike) (*CommentResponse, error) { + resData := &CommentResponse{} res, err := c.req(ctx, "POST", "/comment/like", data, &resData) if err != nil { return nil, err @@ -764,8 +761,8 @@ func (c *Client) LikeComment(ctx context.Context, data types.CreateCommentLike) } // Like / vote on a post. -func (c *Client) LikePost(ctx context.Context, data types.CreatePostLike) (*types.PostResponse, error) { - resData := &types.PostResponse{} +func (c *Client) LikePost(ctx context.Context, data CreatePostLike) (*PostResponse, error) { + resData := &PostResponse{} res, err := c.req(ctx, "POST", "/post/like", data, &resData) if err != nil { return nil, err @@ -778,8 +775,8 @@ func (c *Client) LikePost(ctx context.Context, data types.CreatePostLike) (*type } // List comment reports. -func (c *Client) CommentReports(ctx context.Context, data types.ListCommentReports) (*types.ListCommentReportsResponse, error) { - resData := &types.ListCommentReportsResponse{} +func (c *Client) CommentReports(ctx context.Context, data ListCommentReports) (*ListCommentReportsResponse, error) { + resData := &ListCommentReportsResponse{} res, err := c.getReq(ctx, "GET", "/comment/report/list", data, &resData) if err != nil { return nil, err @@ -792,8 +789,8 @@ func (c *Client) CommentReports(ctx context.Context, data types.ListCommentRepor } // List communities, with various filters. -func (c *Client) Communities(ctx context.Context, data types.ListCommunities) (*types.ListCommunitiesResponse, error) { - resData := &types.ListCommunitiesResponse{} +func (c *Client) Communities(ctx context.Context, data ListCommunities) (*ListCommunitiesResponse, error) { + resData := &ListCommunitiesResponse{} res, err := c.getReq(ctx, "GET", "/community/list", data, &resData) if err != nil { return nil, err @@ -806,8 +803,8 @@ func (c *Client) Communities(ctx context.Context, data types.ListCommunities) (* } // List post reports. -func (c *Client) PostReports(ctx context.Context, data types.ListPostReports) (*types.ListPostReportsResponse, error) { - resData := &types.ListPostReportsResponse{} +func (c *Client) PostReports(ctx context.Context, data ListPostReports) (*ListPostReportsResponse, error) { + resData := &ListPostReportsResponse{} res, err := c.getReq(ctx, "GET", "/post/report/list", data, &resData) if err != nil { return nil, err @@ -820,8 +817,8 @@ func (c *Client) PostReports(ctx context.Context, data types.ListPostReports) (* } // List private message reports. -func (c *Client) PrivateMessageReports(ctx context.Context, data types.ListPrivateMessageReports) (*types.ListPrivateMessageReportsResponse, error) { - resData := &types.ListPrivateMessageReportsResponse{} +func (c *Client) PrivateMessageReports(ctx context.Context, data ListPrivateMessageReports) (*ListPrivateMessageReportsResponse, error) { + resData := &ListPrivateMessageReportsResponse{} res, err := c.getReq(ctx, "GET", "/private_message/report/list", data, &resData) if err != nil { return nil, err @@ -834,8 +831,8 @@ func (c *Client) PrivateMessageReports(ctx context.Context, data types.ListPriva } // List the registration applications. -func (c *Client) RegistrationApplications(ctx context.Context, data types.ListRegistrationApplications) (*types.ListRegistrationApplicationsResponse, error) { - resData := &types.ListRegistrationApplicationsResponse{} +func (c *Client) RegistrationApplications(ctx context.Context, data ListRegistrationApplications) (*ListRegistrationApplicationsResponse, error) { + resData := &ListRegistrationApplicationsResponse{} res, err := c.getReq(ctx, "GET", "/admin/registration_application/list", data, &resData) if err != nil { return nil, err @@ -848,8 +845,8 @@ func (c *Client) RegistrationApplications(ctx context.Context, data types.ListRe } // A moderator can lock a post ( IE disable new comments ). -func (c *Client) LockPost(ctx context.Context, data types.LockPost) (*types.PostResponse, error) { - resData := &types.PostResponse{} +func (c *Client) LockPost(ctx context.Context, data LockPost) (*PostResponse, error) { + resData := &PostResponse{} res, err := c.req(ctx, "POST", "/post/lock", data, &resData) if err != nil { return nil, err @@ -862,8 +859,8 @@ func (c *Client) LockPost(ctx context.Context, data types.LockPost) (*types.Post } // Log into lemmy. -func (c *Client) Login(ctx context.Context, data types.Login) (*types.LoginResponse, error) { - resData := &types.LoginResponse{} +func (c *Client) Login(ctx context.Context, data Login) (*LoginResponse, error) { + resData := &LoginResponse{} res, err := c.req(ctx, "POST", "/user/login", data, &resData) if err != nil { return nil, err @@ -876,8 +873,8 @@ func (c *Client) Login(ctx context.Context, data types.Login) (*types.LoginRespo } // Mark all replies as read. -func (c *Client) MarkAllAsRead(ctx context.Context) (*types.GetRepliesResponse, error) { - resData := &types.GetRepliesResponse{} +func (c *Client) MarkAllAsRead(ctx context.Context) (*GetRepliesResponse, error) { + resData := &GetRepliesResponse{} res, err := c.req(ctx, "POST", "/user/mark_all_as_read", nil, &resData) if err != nil { return nil, err @@ -890,8 +887,8 @@ func (c *Client) MarkAllAsRead(ctx context.Context) (*types.GetRepliesResponse, } // Mark a comment as read. -func (c *Client) MarkCommentReplyAsRead(ctx context.Context, data types.MarkCommentReplyAsRead) (*types.CommentReplyResponse, error) { - resData := &types.CommentReplyResponse{} +func (c *Client) MarkCommentReplyAsRead(ctx context.Context, data MarkCommentReplyAsRead) (*CommentReplyResponse, error) { + resData := &CommentReplyResponse{} res, err := c.req(ctx, "POST", "/comment/mark_as_read", data, &resData) if err != nil { return nil, err @@ -904,8 +901,8 @@ func (c *Client) MarkCommentReplyAsRead(ctx context.Context, data types.MarkComm } // Mark a person mention as read. -func (c *Client) MarkPersonMentionAsRead(ctx context.Context, data types.MarkPersonMentionAsRead) (*types.PersonMentionResponse, error) { - resData := &types.PersonMentionResponse{} +func (c *Client) MarkPersonMentionAsRead(ctx context.Context, data MarkPersonMentionAsRead) (*PersonMentionResponse, error) { + resData := &PersonMentionResponse{} res, err := c.req(ctx, "POST", "/user/mention/mark_as_read", data, &resData) if err != nil { return nil, err @@ -918,8 +915,8 @@ func (c *Client) MarkPersonMentionAsRead(ctx context.Context, data types.MarkPer } // Mark a post as read. -func (c *Client) MarkPostAsRead(ctx context.Context, data types.MarkPostAsRead) (*types.PostResponse, error) { - resData := &types.PostResponse{} +func (c *Client) MarkPostAsRead(ctx context.Context, data MarkPostAsRead) (*PostResponse, error) { + resData := &PostResponse{} res, err := c.req(ctx, "POST", "/post/mark_as_read", data, &resData) if err != nil { return nil, err @@ -932,8 +929,8 @@ func (c *Client) MarkPostAsRead(ctx context.Context, data types.MarkPostAsRead) } // Mark a private message as read. -func (c *Client) MarkPrivateMessageAsRead(ctx context.Context, data types.MarkPrivateMessageAsRead) (*types.PrivateMessageResponse, error) { - resData := &types.PrivateMessageResponse{} +func (c *Client) MarkPrivateMessageAsRead(ctx context.Context, data MarkPrivateMessageAsRead) (*PrivateMessageResponse, error) { + resData := &PrivateMessageResponse{} res, err := c.req(ctx, "POST", "/private_message/mark_as_read", data, &resData) if err != nil { return nil, err @@ -946,8 +943,8 @@ func (c *Client) MarkPrivateMessageAsRead(ctx context.Context, data types.MarkPr } // Change your password from an email / token based reset. -func (c *Client) PasswordChangeAfterReset(ctx context.Context, data types.PasswordChangeAfterReset) (*types.LoginResponse, error) { - resData := &types.LoginResponse{} +func (c *Client) PasswordChangeAfterReset(ctx context.Context, data PasswordChangeAfterReset) (*LoginResponse, error) { + resData := &LoginResponse{} res, err := c.req(ctx, "POST", "/user/password_change", data, &resData) if err != nil { return nil, err @@ -960,8 +957,8 @@ func (c *Client) PasswordChangeAfterReset(ctx context.Context, data types.Passwo } // Reset your password. -func (c *Client) PasswordReset(ctx context.Context, data types.PasswordReset) error { - resData := &types.EmptyResponse{} +func (c *Client) PasswordReset(ctx context.Context, data PasswordReset) error { + resData := &EmptyResponse{} res, err := c.req(ctx, "POST", "/user/password_reset", data, &resData) if err != nil { return err @@ -974,8 +971,8 @@ func (c *Client) PasswordReset(ctx context.Context, data types.PasswordReset) er } // Purge / Delete a comment from the database. -func (c *Client) PurgeComment(ctx context.Context, data types.PurgeComment) (*types.PurgeItemResponse, error) { - resData := &types.PurgeItemResponse{} +func (c *Client) PurgeComment(ctx context.Context, data PurgeComment) (*PurgeItemResponse, error) { + resData := &PurgeItemResponse{} res, err := c.req(ctx, "POST", "/admin/purge/comment", data, &resData) if err != nil { return nil, err @@ -988,8 +985,8 @@ func (c *Client) PurgeComment(ctx context.Context, data types.PurgeComment) (*ty } // Purge / Delete a community from the database. -func (c *Client) PurgeCommunity(ctx context.Context, data types.PurgeCommunity) (*types.PurgeItemResponse, error) { - resData := &types.PurgeItemResponse{} +func (c *Client) PurgeCommunity(ctx context.Context, data PurgeCommunity) (*PurgeItemResponse, error) { + resData := &PurgeItemResponse{} res, err := c.req(ctx, "POST", "/admin/purge/community", data, &resData) if err != nil { return nil, err @@ -1002,8 +999,8 @@ func (c *Client) PurgeCommunity(ctx context.Context, data types.PurgeCommunity) } // Purge / Delete a person from the database. -func (c *Client) PurgePerson(ctx context.Context, data types.PurgePerson) (*types.PurgeItemResponse, error) { - resData := &types.PurgeItemResponse{} +func (c *Client) PurgePerson(ctx context.Context, data PurgePerson) (*PurgeItemResponse, error) { + resData := &PurgeItemResponse{} res, err := c.req(ctx, "POST", "/admin/purge/person", data, &resData) if err != nil { return nil, err @@ -1016,8 +1013,8 @@ func (c *Client) PurgePerson(ctx context.Context, data types.PurgePerson) (*type } // Purge / Delete a post from the database. -func (c *Client) PurgePost(ctx context.Context, data types.PurgePost) (*types.PurgeItemResponse, error) { - resData := &types.PurgeItemResponse{} +func (c *Client) PurgePost(ctx context.Context, data PurgePost) (*PurgeItemResponse, error) { + resData := &PurgeItemResponse{} res, err := c.req(ctx, "POST", "/admin/purge/post", data, &resData) if err != nil { return nil, err @@ -1030,8 +1027,8 @@ func (c *Client) PurgePost(ctx context.Context, data types.PurgePost) (*types.Pu } // Register a new user. -func (c *Client) Register(ctx context.Context, data types.Register) (*types.LoginResponse, error) { - resData := &types.LoginResponse{} +func (c *Client) Register(ctx context.Context, data Register) (*LoginResponse, error) { + resData := &LoginResponse{} res, err := c.req(ctx, "POST", "/user/register", data, &resData) if err != nil { return nil, err @@ -1044,8 +1041,8 @@ func (c *Client) Register(ctx context.Context, data types.Register) (*types.Logi } // A moderator remove for a comment. -func (c *Client) RemoveComment(ctx context.Context, data types.RemoveComment) (*types.CommentResponse, error) { - resData := &types.CommentResponse{} +func (c *Client) RemoveComment(ctx context.Context, data RemoveComment) (*CommentResponse, error) { + resData := &CommentResponse{} res, err := c.req(ctx, "POST", "/comment/remove", data, &resData) if err != nil { return nil, err @@ -1058,8 +1055,8 @@ func (c *Client) RemoveComment(ctx context.Context, data types.RemoveComment) (* } // A moderator remove for a community. -func (c *Client) RemoveCommunity(ctx context.Context, data types.RemoveCommunity) (*types.CommunityResponse, error) { - resData := &types.CommunityResponse{} +func (c *Client) RemoveCommunity(ctx context.Context, data RemoveCommunity) (*CommunityResponse, error) { + resData := &CommunityResponse{} res, err := c.req(ctx, "POST", "/community/remove", data, &resData) if err != nil { return nil, err @@ -1072,8 +1069,8 @@ func (c *Client) RemoveCommunity(ctx context.Context, data types.RemoveCommunity } // A moderator remove for a post. -func (c *Client) RemovePost(ctx context.Context, data types.RemovePost) (*types.PostResponse, error) { - resData := &types.PostResponse{} +func (c *Client) RemovePost(ctx context.Context, data RemovePost) (*PostResponse, error) { + resData := &PostResponse{} res, err := c.req(ctx, "POST", "/post/remove", data, &resData) if err != nil { return nil, err @@ -1086,8 +1083,8 @@ func (c *Client) RemovePost(ctx context.Context, data types.RemovePost) (*types. } // Resolve a comment report. Only a mod can do this. -func (c *Client) ResolveCommentReport(ctx context.Context, data types.ResolveCommentReport) (*types.CommentReportResponse, error) { - resData := &types.CommentReportResponse{} +func (c *Client) ResolveCommentReport(ctx context.Context, data ResolveCommentReport) (*CommentReportResponse, error) { + resData := &CommentReportResponse{} res, err := c.req(ctx, "PUT", "/comment/report/resolve", data, &resData) if err != nil { return nil, err @@ -1100,8 +1097,8 @@ func (c *Client) ResolveCommentReport(ctx context.Context, data types.ResolveCom } // Fetch a non-local / federated object. -func (c *Client) ResolveObject(ctx context.Context, data types.ResolveObject) (*types.ResolveObjectResponse, error) { - resData := &types.ResolveObjectResponse{} +func (c *Client) ResolveObject(ctx context.Context, data ResolveObject) (*ResolveObjectResponse, error) { + resData := &ResolveObjectResponse{} res, err := c.getReq(ctx, "GET", "/resolve_object", data, &resData) if err != nil { return nil, err @@ -1114,8 +1111,8 @@ func (c *Client) ResolveObject(ctx context.Context, data types.ResolveObject) (* } // Resolve a post report. Only a mod can do this. -func (c *Client) ResolvePostReport(ctx context.Context, data types.ResolvePostReport) (*types.PostReportResponse, error) { - resData := &types.PostReportResponse{} +func (c *Client) ResolvePostReport(ctx context.Context, data ResolvePostReport) (*PostReportResponse, error) { + resData := &PostReportResponse{} res, err := c.req(ctx, "PUT", "/post/report/resolve", data, &resData) if err != nil { return nil, err @@ -1128,8 +1125,8 @@ func (c *Client) ResolvePostReport(ctx context.Context, data types.ResolvePostRe } // Resolve a report for a private message. -func (c *Client) ResolvePrivateMessageReport(ctx context.Context, data types.ResolvePrivateMessageReport) (*types.PrivateMessageReportResponse, error) { - resData := &types.PrivateMessageReportResponse{} +func (c *Client) ResolvePrivateMessageReport(ctx context.Context, data ResolvePrivateMessageReport) (*PrivateMessageReportResponse, error) { + resData := &PrivateMessageReportResponse{} res, err := c.req(ctx, "PUT", "/private_message/report/resolve", data, &resData) if err != nil { return nil, err @@ -1142,8 +1139,8 @@ func (c *Client) ResolvePrivateMessageReport(ctx context.Context, data types.Res } // Save a comment. -func (c *Client) SaveComment(ctx context.Context, data types.SaveComment) (*types.CommentResponse, error) { - resData := &types.CommentResponse{} +func (c *Client) SaveComment(ctx context.Context, data SaveComment) (*CommentResponse, error) { + resData := &CommentResponse{} res, err := c.req(ctx, "PUT", "/comment/save", data, &resData) if err != nil { return nil, err @@ -1156,8 +1153,8 @@ func (c *Client) SaveComment(ctx context.Context, data types.SaveComment) (*type } // Save a post. -func (c *Client) SavePost(ctx context.Context, data types.SavePost) (*types.PostResponse, error) { - resData := &types.PostResponse{} +func (c *Client) SavePost(ctx context.Context, data SavePost) (*PostResponse, error) { + resData := &PostResponse{} res, err := c.req(ctx, "PUT", "/post/save", data, &resData) if err != nil { return nil, err @@ -1170,8 +1167,8 @@ func (c *Client) SavePost(ctx context.Context, data types.SavePost) (*types.Post } // Save your user settings. -func (c *Client) SaveUserSettings(ctx context.Context, data types.SaveUserSettings) (*types.LoginResponse, error) { - resData := &types.LoginResponse{} +func (c *Client) SaveUserSettings(ctx context.Context, data SaveUserSettings) (*LoginResponse, error) { + resData := &LoginResponse{} res, err := c.req(ctx, "PUT", "/user/save_user_settings", data, &resData) if err != nil { return nil, err @@ -1184,8 +1181,8 @@ func (c *Client) SaveUserSettings(ctx context.Context, data types.SaveUserSettin } // Search lemmy. -func (c *Client) Search(ctx context.Context, data types.Search) (*types.SearchResponse, error) { - resData := &types.SearchResponse{} +func (c *Client) Search(ctx context.Context, data Search) (*SearchResponse, error) { + resData := &SearchResponse{} res, err := c.getReq(ctx, "GET", "/search", data, &resData) if err != nil { return nil, err @@ -1198,8 +1195,8 @@ func (c *Client) Search(ctx context.Context, data types.Search) (*types.SearchRe } // Transfer your community to an existing moderator. -func (c *Client) TransferCommunity(ctx context.Context, data types.TransferCommunity) (*types.GetCommunityResponse, error) { - resData := &types.GetCommunityResponse{} +func (c *Client) TransferCommunity(ctx context.Context, data TransferCommunity) (*GetCommunityResponse, error) { + resData := &GetCommunityResponse{} res, err := c.req(ctx, "POST", "/community/transfer", data, &resData) if err != nil { return nil, err @@ -1212,8 +1209,8 @@ func (c *Client) TransferCommunity(ctx context.Context, data types.TransferCommu } // Verify your email -func (c *Client) VerifyEmail(ctx context.Context, data types.VerifyEmail) error { - resData := &types.EmptyResponse{} +func (c *Client) VerifyEmail(ctx context.Context, data VerifyEmail) error { + resData := &EmptyResponse{} res, err := c.req(ctx, "POST", "/user/verify_email", data, &resData) if err != nil { return err diff --git a/types/types.gen.go b/types.gen.go similarity index 99% rename from types/types.gen.go rename to types.gen.go index d81de6b..fa2bb46 100644 --- a/types/types.gen.go +++ b/types.gen.go @@ -1,9 +1,124 @@ // Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. -package types +package lemmy import "time" +type GetSiteMetadataResponse struct { + Metadata SiteMetadata `json:"metadata" url:"metadata,omitempty"` + LemmyResponse +} +type BlockCommunityResponse struct { + Blocked bool `json:"blocked" url:"blocked,omitempty"` + CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"` + LemmyResponse +} +type CreatePostReport struct { + PostID int64 `json:"post_id" url:"post_id,omitempty"` + Reason string `json:"reason" url:"reason,omitempty"` +} +type SiteAggregates struct { + Comments int64 `json:"comments" url:"comments,omitempty"` + Communities int64 `json:"communities" url:"communities,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + Posts int64 `json:"posts" url:"posts,omitempty"` + SiteID int64 `json:"site_id" url:"site_id,omitempty"` + Users int64 `json:"users" url:"users,omitempty"` + UsersActiveDay int64 `json:"users_active_day" url:"users_active_day,omitempty"` + UsersActiveHalfYear int64 `json:"users_active_half_year" url:"users_active_half_year,omitempty"` + UsersActiveMonth int64 `json:"users_active_month" url:"users_active_month,omitempty"` + UsersActiveWeek int64 `json:"users_active_week" url:"users_active_week,omitempty"` +} +type CommentReplyView struct { + Comment Comment `json:"comment" url:"comment,omitempty"` + CommentReply CommentReply `json:"comment_reply" url:"comment_reply,omitempty"` + Community Community `json:"community" url:"community,omitempty"` + Counts CommentAggregates `json:"counts" url:"counts,omitempty"` + Creator Person `json:"creator" url:"creator,omitempty"` + CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` + CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` + MyVote Optional[int64] `json:"my_vote" url:"my_vote,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Recipient Person `json:"recipient" url:"recipient,omitempty"` + Saved bool `json:"saved" url:"saved,omitempty"` + Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` +} +type ListCommunities struct { + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + ShowNSFW Optional[bool] `json:"show_nsfw" url:"show_nsfw,omitempty"` + Sort Optional[SortType] `json:"sort" url:"sort,omitempty"` + Type Optional[ListingType] `json:"type_" url:"type_,omitempty"` +} +type ResolvePostReport struct { + ReportID int64 `json:"report_id" url:"report_id,omitempty"` + Resolved bool `json:"resolved" url:"resolved,omitempty"` +} +type GetPost struct { + CommentID Optional[int64] `json:"comment_id" url:"comment_id,omitempty"` + ID Optional[int64] `json:"id" url:"id,omitempty"` +} +type CreatePrivateMessage struct { + Content string `json:"content" url:"content,omitempty"` + RecipientID int64 `json:"recipient_id" url:"recipient_id,omitempty"` +} +type GetCaptchaResponse struct { + Ok Optional[CaptchaResponse] `json:"ok" url:"ok,omitempty"` + LemmyResponse +} +type AdminPurgeCommunityView struct { + Admin Optional[Person] `json:"admin" url:"admin,omitempty"` + AdminPurgeCommunity AdminPurgeCommunity `json:"admin_purge_community" url:"admin_purge_community,omitempty"` +} +type BanFromCommunity struct { + Ban bool `json:"ban" url:"ban,omitempty"` + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + Expires Optional[int64] `json:"expires" url:"expires,omitempty"` + PersonID int64 `json:"person_id" url:"person_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + RemoveData Optional[bool] `json:"remove_data" url:"remove_data,omitempty"` +} +type MyUserInfo struct { + CommunityBlocks []CommunityBlockView `json:"community_blocks" url:"community_blocks,omitempty"` + DiscussionLanguages []int64 `json:"discussion_languages" url:"discussion_languages,omitempty"` + Follows []CommunityFollowerView `json:"follows" url:"follows,omitempty"` + InstanceBlocks []InstanceBlockView `json:"instance_blocks" url:"instance_blocks,omitempty"` + LocalUserView LocalUserView `json:"local_user_view" url:"local_user_view,omitempty"` + Moderates []CommunityModeratorView `json:"moderates" url:"moderates,omitempty"` + PersonBlocks []PersonBlockView `json:"person_blocks" url:"person_blocks,omitempty"` +} +type ModHideCommunityView struct { + Admin Optional[Person] `json:"admin" url:"admin,omitempty"` + Community Community `json:"community" url:"community,omitempty"` + ModHideCommunity ModHideCommunity `json:"mod_hide_community" url:"mod_hide_community,omitempty"` +} +type GetUnreadRegistrationApplicationCountResponse struct { + RegistrationApplications int64 `json:"registration_applications" url:"registration_applications,omitempty"` + LemmyResponse +} +type Post struct { + ApID string `json:"ap_id" url:"ap_id,omitempty"` + Body Optional[string] `json:"body" url:"body,omitempty"` + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + CreatorID int64 `json:"creator_id" url:"creator_id,omitempty"` + Deleted bool `json:"deleted" url:"deleted,omitempty"` + EmbedDescription Optional[string] `json:"embed_description" url:"embed_description,omitempty"` + EmbedTitle Optional[string] `json:"embed_title" url:"embed_title,omitempty"` + EmbedVideoURL Optional[string] `json:"embed_video_url" url:"embed_video_url,omitempty"` + FeaturedCommunity bool `json:"featured_community" url:"featured_community,omitempty"` + FeaturedLocal bool `json:"featured_local" url:"featured_local,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + LanguageID int64 `json:"language_id" url:"language_id,omitempty"` + Local bool `json:"local" url:"local,omitempty"` + Locked bool `json:"locked" url:"locked,omitempty"` + Name string `json:"name" url:"name,omitempty"` + NSFW bool `json:"nsfw" url:"nsfw,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Removed bool `json:"removed" url:"removed,omitempty"` + ThumbnailURL Optional[string] `json:"thumbnail_url" url:"thumbnail_url,omitempty"` + Updated time.Time `json:"updated" url:"updated,omitempty"` + URL Optional[string] `json:"url" url:"url,omitempty"` +} type PostAggregates struct { Comments int64 `json:"comments" url:"comments,omitempty"` CommunityID int64 `json:"community_id" url:"community_id,omitempty"` @@ -24,57 +139,212 @@ type PostAggregates struct { Score int64 `json:"score" url:"score,omitempty"` Upvotes int64 `json:"upvotes" url:"upvotes,omitempty"` } -type SaveUserSettings struct { - AutoExpand Optional[bool] `json:"auto_expand" url:"auto_expand,omitempty"` - Avatar Optional[string] `json:"avatar" url:"avatar,omitempty"` - Banner Optional[string] `json:"banner" url:"banner,omitempty"` - Bio Optional[string] `json:"bio" url:"bio,omitempty"` - BlurNSFW Optional[bool] `json:"blur_nsfw" url:"blur_nsfw,omitempty"` - BotAccount Optional[bool] `json:"bot_account" url:"bot_account,omitempty"` - DefaultListingType Optional[ListingType] `json:"default_listing_type" url:"default_listing_type,omitempty"` - DefaultSortType Optional[SortType] `json:"default_sort_type" url:"default_sort_type,omitempty"` - DiscussionLanguages Optional[[]int64] `json:"discussion_languages" url:"discussion_languages,omitempty"` - DisplayName Optional[string] `json:"display_name" url:"display_name,omitempty"` - Email Optional[string] `json:"email" url:"email,omitempty"` - InfiniteScrollEnabled Optional[bool] `json:"infinite_scroll_enabled" url:"infinite_scroll_enabled,omitempty"` - InterfaceLanguage Optional[string] `json:"interface_language" url:"interface_language,omitempty"` - MatrixUserID Optional[string] `json:"matrix_user_id" url:"matrix_user_id,omitempty"` - OpenLinksInNewTab Optional[bool] `json:"open_links_in_new_tab" url:"open_links_in_new_tab,omitempty"` - SendNotificationsToEmail Optional[bool] `json:"send_notifications_to_email" url:"send_notifications_to_email,omitempty"` - ShowAvatars Optional[bool] `json:"show_avatars" url:"show_avatars,omitempty"` - ShowBotAccounts Optional[bool] `json:"show_bot_accounts" url:"show_bot_accounts,omitempty"` - ShowNewPostNotifs Optional[bool] `json:"show_new_post_notifs" url:"show_new_post_notifs,omitempty"` - ShowNSFW Optional[bool] `json:"show_nsfw" url:"show_nsfw,omitempty"` - ShowReadPosts Optional[bool] `json:"show_read_posts" url:"show_read_posts,omitempty"` - ShowScores Optional[bool] `json:"show_scores" url:"show_scores,omitempty"` - Theme Optional[string] `json:"theme" url:"theme,omitempty"` +type RegistrationMode string + +const ( + RegistrationModeClosed RegistrationMode = "Closed" + RegistrationModeRequireApplication RegistrationMode = "RequireApplication" + RegistrationModeOpen RegistrationMode = "Open" +) + +type PrivateMessage struct { + ApID string `json:"ap_id" url:"ap_id,omitempty"` + Content string `json:"content" url:"content,omitempty"` + CreatorID int64 `json:"creator_id" url:"creator_id,omitempty"` + Deleted bool `json:"deleted" url:"deleted,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + Local bool `json:"local" url:"local,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Read bool `json:"read" url:"read,omitempty"` + RecipientID int64 `json:"recipient_id" url:"recipient_id,omitempty"` + Updated time.Time `json:"updated" url:"updated,omitempty"` } -type CustomEmojiKeyword struct { - CustomEmojiID int64 `json:"custom_emoji_id" url:"custom_emoji_id,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - Keyword string `json:"keyword" url:"keyword,omitempty"` +type FederatedInstances struct { + Allowed []Instance `json:"allowed" url:"allowed,omitempty"` + Blocked []Instance `json:"blocked" url:"blocked,omitempty"` + Linked []Instance `json:"linked" url:"linked,omitempty"` } -type PostView struct { - Community Community `json:"community" url:"community,omitempty"` - Counts PostAggregates `json:"counts" url:"counts,omitempty"` - Creator Person `json:"creator" url:"creator,omitempty"` - CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` - CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` - MyVote Optional[int64] `json:"my_vote" url:"my_vote,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - Read bool `json:"read" url:"read,omitempty"` - Saved bool `json:"saved" url:"saved,omitempty"` - Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` - UnreadComments int64 `json:"unread_comments" url:"unread_comments,omitempty"` +type CreatePostLike struct { + PostID int64 `json:"post_id" url:"post_id,omitempty"` + Score int64 `json:"score" url:"score,omitempty"` } -type GetCommentsResponse struct { - Comments []CommentView `json:"comments" url:"comments,omitempty"` +type EditPrivateMessage struct { + Content string `json:"content" url:"content,omitempty"` + PrivateMessageID int64 `json:"private_message_id" url:"private_message_id,omitempty"` +} +type BannedPersonsResponse struct { + Banned []PersonView `json:"banned" url:"banned,omitempty"` LemmyResponse } +type AdminPurgePerson struct { + AdminPersonID int64 `json:"admin_person_id" url:"admin_person_id,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` +} +type Language struct { + Code string `json:"code" url:"code,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + Name string `json:"name" url:"name,omitempty"` +} +type EditComment struct { + CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` + Content Optional[string] `json:"content" url:"content,omitempty"` + LanguageID Optional[int64] `json:"language_id" url:"language_id,omitempty"` +} +type GetModlogResponse struct { + Added []ModAddView `json:"added" url:"added,omitempty"` + AddedToCommunity []ModAddCommunityView `json:"added_to_community" url:"added_to_community,omitempty"` + AdminPurgedComments []AdminPurgeCommentView `json:"admin_purged_comments" url:"admin_purged_comments,omitempty"` + AdminPurgedCommunities []AdminPurgeCommunityView `json:"admin_purged_communities" url:"admin_purged_communities,omitempty"` + AdminPurgedPersons []AdminPurgePersonView `json:"admin_purged_persons" url:"admin_purged_persons,omitempty"` + AdminPurgedPosts []AdminPurgePostView `json:"admin_purged_posts" url:"admin_purged_posts,omitempty"` + Banned []ModBanView `json:"banned" url:"banned,omitempty"` + BannedFromCommunity []ModBanFromCommunityView `json:"banned_from_community" url:"banned_from_community,omitempty"` + FeaturedPosts []ModFeaturePostView `json:"featured_posts" url:"featured_posts,omitempty"` + HiddenCommunities []ModHideCommunityView `json:"hidden_communities" url:"hidden_communities,omitempty"` + LockedPosts []ModLockPostView `json:"locked_posts" url:"locked_posts,omitempty"` + RemovedComments []ModRemoveCommentView `json:"removed_comments" url:"removed_comments,omitempty"` + RemovedCommunities []ModRemoveCommunityView `json:"removed_communities" url:"removed_communities,omitempty"` + RemovedPosts []ModRemovePostView `json:"removed_posts" url:"removed_posts,omitempty"` + TransferredToCommunity []ModTransferCommunityView `json:"transferred_to_community" url:"transferred_to_community,omitempty"` + LemmyResponse +} +type RemovePost struct { + PostID int64 `json:"post_id" url:"post_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + Removed bool `json:"removed" url:"removed,omitempty"` +} type CommunityFollowerView struct { Community Community `json:"community" url:"community,omitempty"` Follower Person `json:"follower" url:"follower,omitempty"` } +type ResolveCommentReport struct { + ReportID int64 `json:"report_id" url:"report_id,omitempty"` + Resolved bool `json:"resolved" url:"resolved,omitempty"` +} +type CreateCustomEmoji struct { + AltText string `json:"alt_text" url:"alt_text,omitempty"` + Category string `json:"category" url:"category,omitempty"` + ImageURL string `json:"image_url" url:"image_url,omitempty"` + Keywords []string `json:"keywords" url:"keywords,omitempty"` + Shortcode string `json:"shortcode" url:"shortcode,omitempty"` +} +type LocalSiteRateLimit struct { + Comment int64 `json:"comment" url:"comment,omitempty"` + CommentPerSecond int64 `json:"comment_per_second" url:"comment_per_second,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + Image int64 `json:"image" url:"image,omitempty"` + ImagePerSecond int64 `json:"image_per_second" url:"image_per_second,omitempty"` + LocalSiteID int64 `json:"local_site_id" url:"local_site_id,omitempty"` + Message int64 `json:"message" url:"message,omitempty"` + MessagePerSecond int64 `json:"message_per_second" url:"message_per_second,omitempty"` + Post int64 `json:"post" url:"post,omitempty"` + PostPerSecond int64 `json:"post_per_second" url:"post_per_second,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Register int64 `json:"register" url:"register,omitempty"` + RegisterPerSecond int64 `json:"register_per_second" url:"register_per_second,omitempty"` + Search int64 `json:"search" url:"search,omitempty"` + SearchPerSecond int64 `json:"search_per_second" url:"search_per_second,omitempty"` + Updated time.Time `json:"updated" url:"updated,omitempty"` +} +type DeleteCommunity struct { + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + Deleted bool `json:"deleted" url:"deleted,omitempty"` +} +type Person struct { + ActorID string `json:"actor_id" url:"actor_id,omitempty"` + Avatar Optional[string] `json:"avatar" url:"avatar,omitempty"` + BanExpires Optional[string] `json:"ban_expires" url:"ban_expires,omitempty"` + Banned bool `json:"banned" url:"banned,omitempty"` + Banner Optional[string] `json:"banner" url:"banner,omitempty"` + Bio Optional[string] `json:"bio" url:"bio,omitempty"` + BotAccount bool `json:"bot_account" url:"bot_account,omitempty"` + Deleted bool `json:"deleted" url:"deleted,omitempty"` + DisplayName Optional[string] `json:"display_name" url:"display_name,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + InstanceID int64 `json:"instance_id" url:"instance_id,omitempty"` + Local bool `json:"local" url:"local,omitempty"` + MatrixUserID Optional[string] `json:"matrix_user_id" url:"matrix_user_id,omitempty"` + Name string `json:"name" url:"name,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Updated time.Time `json:"updated" url:"updated,omitempty"` +} +type BanPerson struct { + Ban bool `json:"ban" url:"ban,omitempty"` + Expires Optional[int64] `json:"expires" url:"expires,omitempty"` + PersonID int64 `json:"person_id" url:"person_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + RemoveData Optional[bool] `json:"remove_data" url:"remove_data,omitempty"` +} +type ModHideCommunity struct { + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + Hidden bool `json:"hidden" url:"hidden,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` +} +type Community struct { + ActorID string `json:"actor_id" url:"actor_id,omitempty"` + Banner Optional[string] `json:"banner" url:"banner,omitempty"` + Deleted bool `json:"deleted" url:"deleted,omitempty"` + Description Optional[string] `json:"description" url:"description,omitempty"` + Hidden bool `json:"hidden" url:"hidden,omitempty"` + Icon Optional[string] `json:"icon" url:"icon,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + InstanceID int64 `json:"instance_id" url:"instance_id,omitempty"` + Local bool `json:"local" url:"local,omitempty"` + Name string `json:"name" url:"name,omitempty"` + NSFW bool `json:"nsfw" url:"nsfw,omitempty"` + PostingRestrictedToMods bool `json:"posting_restricted_to_mods" url:"posting_restricted_to_mods,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Removed bool `json:"removed" url:"removed,omitempty"` + Title string `json:"title" url:"title,omitempty"` + Updated time.Time `json:"updated" url:"updated,omitempty"` +} +type ResolvePrivateMessageReport struct { + ReportID int64 `json:"report_id" url:"report_id,omitempty"` + Resolved bool `json:"resolved" url:"resolved,omitempty"` +} +type CommentView struct { + Comment Comment `json:"comment" url:"comment,omitempty"` + Community Community `json:"community" url:"community,omitempty"` + Counts CommentAggregates `json:"counts" url:"counts,omitempty"` + Creator Person `json:"creator" url:"creator,omitempty"` + CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` + CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` + MyVote Optional[int64] `json:"my_vote" url:"my_vote,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Saved bool `json:"saved" url:"saved,omitempty"` + Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` +} +type GetPostResponse struct { + CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"` + CrossPosts []PostView `json:"cross_posts" url:"cross_posts,omitempty"` + Moderators []CommunityModeratorView `json:"moderators" url:"moderators,omitempty"` + PostView PostView `json:"post_view" url:"post_view,omitempty"` + LemmyResponse +} +type CreateCommentLike struct { + CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` + Score int64 `json:"score" url:"score,omitempty"` +} +type PurgeComment struct { + CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` +} +type PostReportView struct { + Community Community `json:"community" url:"community,omitempty"` + Counts PostAggregates `json:"counts" url:"counts,omitempty"` + Creator Person `json:"creator" url:"creator,omitempty"` + CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` + MyVote Optional[int64] `json:"my_vote" url:"my_vote,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + PostCreator Person `json:"post_creator" url:"post_creator,omitempty"` + PostReport PostReport `json:"post_report" url:"post_report,omitempty"` + Resolver Optional[Person] `json:"resolver" url:"resolver,omitempty"` +} type EditCommunity struct { Banner Optional[string] `json:"banner" url:"banner,omitempty"` CommunityID int64 `json:"community_id" url:"community_id,omitempty"` @@ -85,6 +355,136 @@ type EditCommunity struct { PostingRestrictedToMods Optional[bool] `json:"posting_restricted_to_mods" url:"posting_restricted_to_mods,omitempty"` Title Optional[string] `json:"title" url:"title,omitempty"` } +type ModRemoveCommunity struct { + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + Expires Optional[string] `json:"expires" url:"expires,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + Removed bool `json:"removed" url:"removed,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` +} +type PasswordReset struct { + Email string `json:"email" url:"email,omitempty"` +} +type SavePost struct { + PostID int64 `json:"post_id" url:"post_id,omitempty"` + Save bool `json:"save" url:"save,omitempty"` +} +type TransferCommunity struct { + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + PersonID int64 `json:"person_id" url:"person_id,omitempty"` +} +type DeleteCustomEmojiResponse struct { + ID int64 `json:"id" url:"id,omitempty"` + Success bool `json:"success" url:"success,omitempty"` + LemmyResponse +} +type GetComments struct { + CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` + CommunityName Optional[string] `json:"community_name" url:"community_name,omitempty"` + DislikedOnly Optional[bool] `json:"disliked_only" url:"disliked_only,omitempty"` + LikedOnly Optional[bool] `json:"liked_only" url:"liked_only,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + MaxDepth Optional[int64] `json:"max_depth" url:"max_depth,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + ParentID Optional[int64] `json:"parent_id" url:"parent_id,omitempty"` + PostID Optional[int64] `json:"post_id" url:"post_id,omitempty"` + SavedOnly Optional[bool] `json:"saved_only" url:"saved_only,omitempty"` + Sort Optional[CommentSortType] `json:"sort" url:"sort,omitempty"` + Type Optional[ListingType] `json:"type_" url:"type_,omitempty"` +} +type GetPersonDetailsResponse struct { + Comments []CommentView `json:"comments" url:"comments,omitempty"` + Moderates []CommunityModeratorView `json:"moderates" url:"moderates,omitempty"` + PersonView PersonView `json:"person_view" url:"person_view,omitempty"` + Posts []PostView `json:"posts" url:"posts,omitempty"` + LemmyResponse +} +type DeleteAccount struct { + DeleteContent bool `json:"delete_content" url:"delete_content,omitempty"` + Password string `json:"password" url:"password,omitempty"` +} +type EditCustomEmoji struct { + AltText string `json:"alt_text" url:"alt_text,omitempty"` + Category string `json:"category" url:"category,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + ImageURL string `json:"image_url" url:"image_url,omitempty"` + Keywords []string `json:"keywords" url:"keywords,omitempty"` +} +type ListPostReportsResponse struct { + PostReports []PostReportView `json:"post_reports" url:"post_reports,omitempty"` + LemmyResponse +} +type RemoveComment struct { + CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + Removed bool `json:"removed" url:"removed,omitempty"` +} +type Site struct { + ActorID string `json:"actor_id" url:"actor_id,omitempty"` + Banner Optional[string] `json:"banner" url:"banner,omitempty"` + Description Optional[string] `json:"description" url:"description,omitempty"` + Icon Optional[string] `json:"icon" url:"icon,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + InboxURL string `json:"inbox_url" url:"inbox_url,omitempty"` + InstanceID int64 `json:"instance_id" url:"instance_id,omitempty"` + LastRefreshedAt string `json:"last_refreshed_at" url:"last_refreshed_at,omitempty"` + Name string `json:"name" url:"name,omitempty"` + PrivateKey Optional[string] `json:"private_key" url:"private_key,omitempty"` + PublicKey string `json:"public_key" url:"public_key,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Sidebar Optional[string] `json:"sidebar" url:"sidebar,omitempty"` + Updated time.Time `json:"updated" url:"updated,omitempty"` +} +type DeletePrivateMessage struct { + Deleted bool `json:"deleted" url:"deleted,omitempty"` + PrivateMessageID int64 `json:"private_message_id" url:"private_message_id,omitempty"` +} +type AdminPurgePersonView struct { + Admin Optional[Person] `json:"admin" url:"admin,omitempty"` + AdminPurgePerson AdminPurgePerson `json:"admin_purge_person" url:"admin_purge_person,omitempty"` +} +type ModBanFromCommunityView struct { + BannedPerson Person `json:"banned_person" url:"banned_person,omitempty"` + Community Community `json:"community" url:"community,omitempty"` + ModBanFromCommunity ModBanFromCommunity `json:"mod_ban_from_community" url:"mod_ban_from_community,omitempty"` + Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` +} +type ListPostReports struct { + CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + UnresolvedOnly Optional[bool] `json:"unresolved_only" url:"unresolved_only,omitempty"` +} +type LocalSite struct { + ActorNameMaxLength int64 `json:"actor_name_max_length" url:"actor_name_max_length,omitempty"` + ApplicationEmailAdmins bool `json:"application_email_admins" url:"application_email_admins,omitempty"` + ApplicationQuestion Optional[string] `json:"application_question" url:"application_question,omitempty"` + CaptchaDifficulty string `json:"captcha_difficulty" url:"captcha_difficulty,omitempty"` + CaptchaEnabled bool `json:"captcha_enabled" url:"captcha_enabled,omitempty"` + CommunityCreationAdminOnly bool `json:"community_creation_admin_only" url:"community_creation_admin_only,omitempty"` + DefaultPostListingType ListingType `json:"default_post_listing_type" url:"default_post_listing_type,omitempty"` + DefaultTheme string `json:"default_theme" url:"default_theme,omitempty"` + EnableDownvotes bool `json:"enable_downvotes" url:"enable_downvotes,omitempty"` + EnableNSFW bool `json:"enable_nsfw" url:"enable_nsfw,omitempty"` + FederationEnabled bool `json:"federation_enabled" url:"federation_enabled,omitempty"` + HideModlogModNames bool `json:"hide_modlog_mod_names" url:"hide_modlog_mod_names,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + LegalInformation Optional[string] `json:"legal_information" url:"legal_information,omitempty"` + PrivateInstance bool `json:"private_instance" url:"private_instance,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + RegistrationMode RegistrationMode `json:"registration_mode" url:"registration_mode,omitempty"` + ReportsEmailAdmins bool `json:"reports_email_admins" url:"reports_email_admins,omitempty"` + RequireEmailVerification bool `json:"require_email_verification" url:"require_email_verification,omitempty"` + SiteID int64 `json:"site_id" url:"site_id,omitempty"` + SiteSetup bool `json:"site_setup" url:"site_setup,omitempty"` + SlurFilterRegex Optional[string] `json:"slur_filter_regex" url:"slur_filter_regex,omitempty"` + Updated time.Time `json:"updated" url:"updated,omitempty"` +} +type DeleteCustomEmoji struct { + ID int64 `json:"id" url:"id,omitempty"` +} type Instance struct { Domain string `json:"domain" url:"domain,omitempty"` ID int64 `json:"id" url:"id,omitempty"` @@ -93,32 +493,27 @@ type Instance struct { Updated time.Time `json:"updated" url:"updated,omitempty"` Version Optional[string] `json:"version" url:"version,omitempty"` } -type AdminPurgePost struct { - AdminPersonID int64 `json:"admin_person_id" url:"admin_person_id,omitempty"` - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type PurgePerson struct { - PersonID int64 `json:"person_id" url:"person_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` -} -type MarkCommentReplyAsRead struct { - CommentReplyID int64 `json:"comment_reply_id" url:"comment_reply_id,omitempty"` - Read bool `json:"read" url:"read,omitempty"` -} -type GetFederatedInstancesResponse struct { - FederatedInstances Optional[FederatedInstances] `json:"federated_instances" url:"federated_instances,omitempty"` +type CommentReportResponse struct { + CommentReportView CommentReportView `json:"comment_report_view" url:"comment_report_view,omitempty"` LemmyResponse } -type ModRemoveComment struct { - CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` +type ListPrivateMessageReportsResponse struct { + PrivateMessageReports []PrivateMessageReportView `json:"private_message_reports" url:"private_message_reports,omitempty"` + LemmyResponse +} +type ModLockPostView struct { + Community Community `json:"community" url:"community,omitempty"` + ModLockPost ModLockPost `json:"mod_lock_post" url:"mod_lock_post,omitempty"` + Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` + Post Post `json:"post" url:"post,omitempty"` +} +type PurgeItemResponse struct { + Success bool `json:"success" url:"success,omitempty"` + LemmyResponse +} +type PersonView struct { + Counts PersonAggregates `json:"counts" url:"counts,omitempty"` + Person Person `json:"person" url:"person,omitempty"` } type ModRemoveCommunityView struct { Community Community `json:"community" url:"community,omitempty"` @@ -128,39 +523,105 @@ type ModRemoveCommunityView struct { type GetSiteMetadata struct { URL string `json:"url" url:"url,omitempty"` } -type ListCommunities struct { - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - ShowNSFW Optional[bool] `json:"show_nsfw" url:"show_nsfw,omitempty"` - Sort Optional[SortType] `json:"sort" url:"sort,omitempty"` - Type Optional[ListingType] `json:"type_" url:"type_,omitempty"` +type Register struct { + Answer Optional[string] `json:"answer" url:"answer,omitempty"` + CaptchaAnswer Optional[string] `json:"captcha_answer" url:"captcha_answer,omitempty"` + CaptchaUUID Optional[string] `json:"captcha_uuid" url:"captcha_uuid,omitempty"` + Email Optional[string] `json:"email" url:"email,omitempty"` + Honeypot Optional[string] `json:"honeypot" url:"honeypot,omitempty"` + Password string `json:"password" url:"password,omitempty"` + PasswordVerify string `json:"password_verify" url:"password_verify,omitempty"` + ShowNSFW bool `json:"show_nsfw" url:"show_nsfw,omitempty"` + Username string `json:"username" url:"username,omitempty"` } -type RemoveComment struct { - CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` +type AddModToCommunity struct { + Added bool `json:"added" url:"added,omitempty"` + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + PersonID int64 `json:"person_id" url:"person_id,omitempty"` } -type GetReportCountResponse struct { - CommentReports int64 `json:"comment_reports" url:"comment_reports,omitempty"` - CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` - PostReports int64 `json:"post_reports" url:"post_reports,omitempty"` - PrivateMessageReports Optional[int64] `json:"private_message_reports" url:"private_message_reports,omitempty"` +type CommentReport struct { + CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` + CreatorID int64 `json:"creator_id" url:"creator_id,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + OriginalCommentText string `json:"original_comment_text" url:"original_comment_text,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Reason string `json:"reason" url:"reason,omitempty"` + Resolved bool `json:"resolved" url:"resolved,omitempty"` + ResolverID Optional[int64] `json:"resolver_id" url:"resolver_id,omitempty"` + Updated time.Time `json:"updated" url:"updated,omitempty"` +} +type PostReportResponse struct { + PostReportView PostReportView `json:"post_report_view" url:"post_report_view,omitempty"` LemmyResponse } -type ResolvePostReport struct { - ReportID int64 `json:"report_id" url:"report_id,omitempty"` - Resolved bool `json:"resolved" url:"resolved,omitempty"` -} -type BanFromCommunityResponse struct { - Banned bool `json:"banned" url:"banned,omitempty"` - PersonView PersonView `json:"person_view" url:"person_view,omitempty"` +type GetPersonMentionsResponse struct { + Mentions []PersonMentionView `json:"mentions" url:"mentions,omitempty"` LemmyResponse } -type BlockPersonResponse struct { - Blocked bool `json:"blocked" url:"blocked,omitempty"` - PersonView PersonView `json:"person_view" url:"person_view,omitempty"` +type AddAdminResponse struct { + Admins []PersonView `json:"admins" url:"admins,omitempty"` LemmyResponse } +type DeletePost struct { + Deleted bool `json:"deleted" url:"deleted,omitempty"` + PostID int64 `json:"post_id" url:"post_id,omitempty"` +} +type GetPersonDetails struct { + CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + PersonID Optional[int64] `json:"person_id" url:"person_id,omitempty"` + SavedOnly Optional[bool] `json:"saved_only" url:"saved_only,omitempty"` + Sort Optional[SortType] `json:"sort" url:"sort,omitempty"` + Username Optional[string] `json:"username" url:"username,omitempty"` +} +type CommentReportView struct { + Comment Comment `json:"comment" url:"comment,omitempty"` + CommentCreator Person `json:"comment_creator" url:"comment_creator,omitempty"` + CommentReport CommentReport `json:"comment_report" url:"comment_report,omitempty"` + Community Community `json:"community" url:"community,omitempty"` + Counts CommentAggregates `json:"counts" url:"counts,omitempty"` + Creator Person `json:"creator" url:"creator,omitempty"` + CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` + MyVote Optional[int64] `json:"my_vote" url:"my_vote,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Resolver Optional[Person] `json:"resolver" url:"resolver,omitempty"` +} +type CreatePrivateMessageReport struct { + PrivateMessageID int64 `json:"private_message_id" url:"private_message_id,omitempty"` + Reason string `json:"reason" url:"reason,omitempty"` +} +type CommentResponse struct { + CommentView CommentView `json:"comment_view" url:"comment_view,omitempty"` + RecipientIDs []int64 `json:"recipient_ids" url:"recipient_ids,omitempty"` + LemmyResponse +} +type GetCommunity struct { + ID Optional[int64] `json:"id" url:"id,omitempty"` + Name Optional[string] `json:"name" url:"name,omitempty"` +} +type CommunityBlockView struct { + Community Community `json:"community" url:"community,omitempty"` + Person Person `json:"person" url:"person,omitempty"` +} +type ApproveRegistrationApplication struct { + Approve bool `json:"approve" url:"approve,omitempty"` + DenyReason Optional[string] `json:"deny_reason" url:"deny_reason,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` +} +type ListingType string + +const ( + ListingTypeAll ListingType = "All" + ListingTypeLocal ListingType = "Local" + ListingTypeSubscribed ListingType = "Subscribed" + ListingTypeModeratorView ListingType = "ModeratorView" +) + +type BlockInstance struct { + Block bool `json:"block" url:"block,omitempty"` + InstanceID int64 `json:"instance_id" url:"instance_id,omitempty"` +} type PrivateMessageReportView struct { Creator Person `json:"creator" url:"creator,omitempty"` PrivateMessage PrivateMessage `json:"private_message" url:"private_message,omitempty"` @@ -168,6 +629,79 @@ type PrivateMessageReportView struct { PrivateMessageReport PrivateMessageReport `json:"private_message_report" url:"private_message_report,omitempty"` Resolver Optional[Person] `json:"resolver" url:"resolver,omitempty"` } +type PersonBlockView struct { + Person Person `json:"person" url:"person,omitempty"` + Target Person `json:"target" url:"target,omitempty"` +} +type RemoveCommunity struct { + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + Expires Optional[int64] `json:"expires" url:"expires,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + Removed bool `json:"removed" url:"removed,omitempty"` +} +type ModRemoveCommentView struct { + Comment Comment `json:"comment" url:"comment,omitempty"` + Commenter Person `json:"commenter" url:"commenter,omitempty"` + Community Community `json:"community" url:"community,omitempty"` + ModRemoveComment ModRemoveComment `json:"mod_remove_comment" url:"mod_remove_comment,omitempty"` + Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` + Post Post `json:"post" url:"post,omitempty"` +} +type ListRegistrationApplications struct { + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` +} +type LocalUser struct { + AcceptedApplication bool `json:"accepted_application" url:"accepted_application,omitempty"` + Admin bool `json:"admin" url:"admin,omitempty"` + AutoExpand bool `json:"auto_expand" url:"auto_expand,omitempty"` + BlurNSFW bool `json:"blur_nsfw" url:"blur_nsfw,omitempty"` + DefaultListingType ListingType `json:"default_listing_type" url:"default_listing_type,omitempty"` + DefaultSortType SortType `json:"default_sort_type" url:"default_sort_type,omitempty"` + Email Optional[string] `json:"email" url:"email,omitempty"` + EmailVerified bool `json:"email_verified" url:"email_verified,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + InfiniteScrollEnabled bool `json:"infinite_scroll_enabled" url:"infinite_scroll_enabled,omitempty"` + InterfaceLanguage string `json:"interface_language" url:"interface_language,omitempty"` + OpenLinksInNewTab bool `json:"open_links_in_new_tab" url:"open_links_in_new_tab,omitempty"` + PersonID int64 `json:"person_id" url:"person_id,omitempty"` + PostListingMode PostListingMode `json:"post_listing_mode" url:"post_listing_mode,omitempty"` + SendNotificationsToEmail bool `json:"send_notifications_to_email" url:"send_notifications_to_email,omitempty"` + ShowAvatars bool `json:"show_avatars" url:"show_avatars,omitempty"` + ShowBotAccounts bool `json:"show_bot_accounts" url:"show_bot_accounts,omitempty"` + ShowNewPostNotifs bool `json:"show_new_post_notifs" url:"show_new_post_notifs,omitempty"` + ShowNSFW bool `json:"show_nsfw" url:"show_nsfw,omitempty"` + ShowReadPosts bool `json:"show_read_posts" url:"show_read_posts,omitempty"` + ShowScores bool `json:"show_scores" url:"show_scores,omitempty"` + Theme string `json:"theme" url:"theme,omitempty"` + TOTP2FAEnabled bool `json:"totp_2fa_enabled" url:"totp_2fa_enabled,omitempty"` + ValidatorTime string `json:"validator_time" url:"validator_time,omitempty"` +} +type EditPost struct { + Body Optional[string] `json:"body" url:"body,omitempty"` + LanguageID Optional[int64] `json:"language_id" url:"language_id,omitempty"` + Name Optional[string] `json:"name" url:"name,omitempty"` + NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` + PostID int64 `json:"post_id" url:"post_id,omitempty"` + URL Optional[string] `json:"url" url:"url,omitempty"` +} +type GetCommentsResponse struct { + Comments []CommentView `json:"comments" url:"comments,omitempty"` + LemmyResponse +} +type ModRemovePostView struct { + Community Community `json:"community" url:"community,omitempty"` + ModRemovePost ModRemovePost `json:"mod_remove_post" url:"mod_remove_post,omitempty"` + Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` + Post Post `json:"post" url:"post,omitempty"` +} +type ModTransferCommunityView struct { + Community Community `json:"community" url:"community,omitempty"` + ModTransferCommunity ModTransferCommunity `json:"mod_transfer_community" url:"mod_transfer_community,omitempty"` + ModdedPerson Person `json:"modded_person" url:"modded_person,omitempty"` + Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` +} type CreateSite struct { ActorNameMaxLength Optional[int64] `json:"actor_name_max_length" url:"actor_name_max_length,omitempty"` AllowedInstances Optional[[]string] `json:"allowed_instances" url:"allowed_instances,omitempty"` @@ -209,184 +743,29 @@ type CreateSite struct { SlurFilterRegex Optional[string] `json:"slur_filter_regex" url:"slur_filter_regex,omitempty"` Taglines Optional[[]string] `json:"taglines" url:"taglines,omitempty"` } -type BlockInstance struct { - Block bool `json:"block" url:"block,omitempty"` - InstanceID int64 `json:"instance_id" url:"instance_id,omitempty"` +type PrivateMessagesResponse struct { + PrivateMessages []PrivateMessageView `json:"private_messages" url:"private_messages,omitempty"` + LemmyResponse } -type SiteAggregates struct { - Comments int64 `json:"comments" url:"comments,omitempty"` - Communities int64 `json:"communities" url:"communities,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - Posts int64 `json:"posts" url:"posts,omitempty"` - SiteID int64 `json:"site_id" url:"site_id,omitempty"` - Users int64 `json:"users" url:"users,omitempty"` - UsersActiveDay int64 `json:"users_active_day" url:"users_active_day,omitempty"` - UsersActiveHalfYear int64 `json:"users_active_half_year" url:"users_active_half_year,omitempty"` - UsersActiveMonth int64 `json:"users_active_month" url:"users_active_month,omitempty"` - UsersActiveWeek int64 `json:"users_active_week" url:"users_active_week,omitempty"` +type ResolveObject struct { + Q string `json:"q" url:"q,omitempty"` } -type DeletePrivateMessage struct { - Deleted bool `json:"deleted" url:"deleted,omitempty"` - PrivateMessageID int64 `json:"private_message_id" url:"private_message_id,omitempty"` -} -type GetPosts struct { - CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` - CommunityName Optional[string] `json:"community_name" url:"community_name,omitempty"` - DislikedOnly Optional[bool] `json:"disliked_only" url:"disliked_only,omitempty"` - LikedOnly Optional[bool] `json:"liked_only" url:"liked_only,omitempty"` - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - PageCursor Optional[string] `json:"page_cursor" url:"page_cursor,omitempty"` - SavedOnly Optional[bool] `json:"saved_only" url:"saved_only,omitempty"` - Sort Optional[SortType] `json:"sort" url:"sort,omitempty"` - Type Optional[ListingType] `json:"type_" url:"type_,omitempty"` -} -type CreatePrivateMessageReport struct { - PrivateMessageID int64 `json:"private_message_id" url:"private_message_id,omitempty"` - Reason string `json:"reason" url:"reason,omitempty"` -} -type ModBan struct { - Banned bool `json:"banned" url:"banned,omitempty"` - Expires Optional[string] `json:"expires" url:"expires,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` - OtherPersonID int64 `json:"other_person_id" url:"other_person_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type ModHideCommunityView struct { - Admin Optional[Person] `json:"admin" url:"admin,omitempty"` - Community Community `json:"community" url:"community,omitempty"` - ModHideCommunity ModHideCommunity `json:"mod_hide_community" url:"mod_hide_community,omitempty"` -} -type PostListingMode string +type SubscribedType string const ( - PostListingModeList PostListingMode = "List" - PostListingModeCard PostListingMode = "Card" - PostListingModeSmallCard PostListingMode = "SmallCard" + SubscribedTypeSubscribed SubscribedType = "Subscribed" + SubscribedTypeNotSubscribed SubscribedType = "NotSubscribed" + SubscribedTypePending SubscribedType = "Pending" ) -type DeletePost struct { - Deleted bool `json:"deleted" url:"deleted,omitempty"` - PostID int64 `json:"post_id" url:"post_id,omitempty"` -} -type GetCommunity struct { - ID Optional[int64] `json:"id" url:"id,omitempty"` - Name Optional[string] `json:"name" url:"name,omitempty"` -} -type SaveComment struct { - CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` - Save bool `json:"save" url:"save,omitempty"` -} -type Post struct { - ApID string `json:"ap_id" url:"ap_id,omitempty"` - Body Optional[string] `json:"body" url:"body,omitempty"` - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - CreatorID int64 `json:"creator_id" url:"creator_id,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` - EmbedDescription Optional[string] `json:"embed_description" url:"embed_description,omitempty"` - EmbedTitle Optional[string] `json:"embed_title" url:"embed_title,omitempty"` - EmbedVideoURL Optional[string] `json:"embed_video_url" url:"embed_video_url,omitempty"` - FeaturedCommunity bool `json:"featured_community" url:"featured_community,omitempty"` - FeaturedLocal bool `json:"featured_local" url:"featured_local,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - LanguageID int64 `json:"language_id" url:"language_id,omitempty"` - Local bool `json:"local" url:"local,omitempty"` - Locked bool `json:"locked" url:"locked,omitempty"` - Name string `json:"name" url:"name,omitempty"` - NSFW bool `json:"nsfw" url:"nsfw,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` - ThumbnailURL Optional[string] `json:"thumbnail_url" url:"thumbnail_url,omitempty"` - Updated time.Time `json:"updated" url:"updated,omitempty"` - URL Optional[string] `json:"url" url:"url,omitempty"` -} -type CustomEmojiView struct { - CustomEmoji CustomEmoji `json:"custom_emoji" url:"custom_emoji,omitempty"` - Keywords []CustomEmojiKeyword `json:"keywords" url:"keywords,omitempty"` -} -type GetPostResponse struct { - CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"` - CrossPosts []PostView `json:"cross_posts" url:"cross_posts,omitempty"` - Moderators []CommunityModeratorView `json:"moderators" url:"moderators,omitempty"` - PostView PostView `json:"post_view" url:"post_view,omitempty"` +type BlockPersonResponse struct { + Blocked bool `json:"blocked" url:"blocked,omitempty"` + PersonView PersonView `json:"person_view" url:"person_view,omitempty"` LemmyResponse } -type CreateCommunity struct { - Banner Optional[string] `json:"banner" url:"banner,omitempty"` - Description Optional[string] `json:"description" url:"description,omitempty"` - DiscussionLanguages Optional[[]int64] `json:"discussion_languages" url:"discussion_languages,omitempty"` - Icon Optional[string] `json:"icon" url:"icon,omitempty"` - Name string `json:"name" url:"name,omitempty"` - NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` - PostingRestrictedToMods Optional[bool] `json:"posting_restricted_to_mods" url:"posting_restricted_to_mods,omitempty"` - Title string `json:"title" url:"title,omitempty"` -} -type FederatedInstances struct { - Allowed []Instance `json:"allowed" url:"allowed,omitempty"` - Blocked []Instance `json:"blocked" url:"blocked,omitempty"` - Linked []Instance `json:"linked" url:"linked,omitempty"` -} -type PersonMentionResponse struct { - PersonMentionView PersonMentionView `json:"person_mention_view" url:"person_mention_view,omitempty"` - LemmyResponse -} -type Login struct { - Password string `json:"password" url:"password,omitempty"` - TOTP2FAToken Optional[string] `json:"totp_2fa_token" url:"totp_2fa_token,omitempty"` - UsernameOrEmail string `json:"username_or_email" url:"username_or_email,omitempty"` -} -type CommentReplyResponse struct { - CommentReplyView CommentReplyView `json:"comment_reply_view" url:"comment_reply_view,omitempty"` - LemmyResponse -} -type Person struct { - ActorID string `json:"actor_id" url:"actor_id,omitempty"` - Avatar Optional[string] `json:"avatar" url:"avatar,omitempty"` - BanExpires Optional[string] `json:"ban_expires" url:"ban_expires,omitempty"` - Banned bool `json:"banned" url:"banned,omitempty"` - Banner Optional[string] `json:"banner" url:"banner,omitempty"` - Bio Optional[string] `json:"bio" url:"bio,omitempty"` - BotAccount bool `json:"bot_account" url:"bot_account,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` - DisplayName Optional[string] `json:"display_name" url:"display_name,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - InstanceID int64 `json:"instance_id" url:"instance_id,omitempty"` - Local bool `json:"local" url:"local,omitempty"` - MatrixUserID Optional[string] `json:"matrix_user_id" url:"matrix_user_id,omitempty"` - Name string `json:"name" url:"name,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Updated time.Time `json:"updated" url:"updated,omitempty"` -} -type PrivateMessageReportResponse struct { - PrivateMessageReportView PrivateMessageReportView `json:"private_message_report_view" url:"private_message_report_view,omitempty"` - LemmyResponse -} -type PersonBlockView struct { - Person Person `json:"person" url:"person,omitempty"` - Target Person `json:"target" url:"target,omitempty"` -} -type HideCommunity struct { - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - Hidden bool `json:"hidden" url:"hidden,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` -} -type LoginResponse struct { - JWT Optional[string] `json:"jwt" url:"jwt,omitempty"` - RegistrationCreated bool `json:"registration_created" url:"registration_created,omitempty"` - VerifyEmailSent bool `json:"verify_email_sent" url:"verify_email_sent,omitempty"` - LemmyResponse -} -type ModRemovePostView struct { - Community Community `json:"community" url:"community,omitempty"` - ModRemovePost ModRemovePost `json:"mod_remove_post" url:"mod_remove_post,omitempty"` - Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` - Post Post `json:"post" url:"post,omitempty"` -} -type BannedPersonsResponse struct { - Banned []PersonView `json:"banned" url:"banned,omitempty"` - LemmyResponse +type MarkPrivateMessageAsRead struct { + PrivateMessageID int64 `json:"private_message_id" url:"private_message_id,omitempty"` + Read bool `json:"read" url:"read,omitempty"` } type GetSiteResponse struct { Admins []PersonView `json:"admins" url:"admins,omitempty"` @@ -399,126 +778,17 @@ type GetSiteResponse struct { Version string `json:"version" url:"version,omitempty"` LemmyResponse } -type PurgeCommunity struct { +type VerifyEmail struct { + Token string `json:"token" url:"token,omitempty"` +} +type CreatePost struct { + Body Optional[string] `json:"body" url:"body,omitempty"` CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` -} -type DeleteComment struct { - CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` -} -type AdminPurgeComment struct { - AdminPersonID int64 `json:"admin_person_id" url:"admin_person_id,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - PostID int64 `json:"post_id" url:"post_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type RemovePost struct { - PostID int64 `json:"post_id" url:"post_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` -} -type ResolveObjectResponse struct { - Comment Optional[CommentView] `json:"comment" url:"comment,omitempty"` - Community Optional[CommunityView] `json:"community" url:"community,omitempty"` - Person Optional[PersonView] `json:"person" url:"person,omitempty"` - Post Optional[PostView] `json:"post" url:"post,omitempty"` - LemmyResponse -} -type PersonView struct { - Counts PersonAggregates `json:"counts" url:"counts,omitempty"` - Person Person `json:"person" url:"person,omitempty"` -} -type LocalUser struct { - AcceptedApplication bool `json:"accepted_application" url:"accepted_application,omitempty"` - Admin bool `json:"admin" url:"admin,omitempty"` - AutoExpand bool `json:"auto_expand" url:"auto_expand,omitempty"` - BlurNSFW bool `json:"blur_nsfw" url:"blur_nsfw,omitempty"` - DefaultListingType ListingType `json:"default_listing_type" url:"default_listing_type,omitempty"` - DefaultSortType SortType `json:"default_sort_type" url:"default_sort_type,omitempty"` - Email Optional[string] `json:"email" url:"email,omitempty"` - EmailVerified bool `json:"email_verified" url:"email_verified,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - InfiniteScrollEnabled bool `json:"infinite_scroll_enabled" url:"infinite_scroll_enabled,omitempty"` - InterfaceLanguage string `json:"interface_language" url:"interface_language,omitempty"` - OpenLinksInNewTab bool `json:"open_links_in_new_tab" url:"open_links_in_new_tab,omitempty"` - PersonID int64 `json:"person_id" url:"person_id,omitempty"` - PostListingMode PostListingMode `json:"post_listing_mode" url:"post_listing_mode,omitempty"` - SendNotificationsToEmail bool `json:"send_notifications_to_email" url:"send_notifications_to_email,omitempty"` - ShowAvatars bool `json:"show_avatars" url:"show_avatars,omitempty"` - ShowBotAccounts bool `json:"show_bot_accounts" url:"show_bot_accounts,omitempty"` - ShowNewPostNotifs bool `json:"show_new_post_notifs" url:"show_new_post_notifs,omitempty"` - ShowNSFW bool `json:"show_nsfw" url:"show_nsfw,omitempty"` - ShowReadPosts bool `json:"show_read_posts" url:"show_read_posts,omitempty"` - ShowScores bool `json:"show_scores" url:"show_scores,omitempty"` - Theme string `json:"theme" url:"theme,omitempty"` - TOTP2FAEnabled bool `json:"totp_2fa_enabled" url:"totp_2fa_enabled,omitempty"` - ValidatorTime string `json:"validator_time" url:"validator_time,omitempty"` -} -type BlockCommunity struct { - Block bool `json:"block" url:"block,omitempty"` - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` -} -type BlockPerson struct { - Block bool `json:"block" url:"block,omitempty"` - PersonID int64 `json:"person_id" url:"person_id,omitempty"` -} -type RegistrationApplicationResponse struct { - RegistrationApplication RegistrationApplicationView `json:"registration_application" url:"registration_application,omitempty"` - LemmyResponse -} -type CommunityView struct { - Blocked bool `json:"blocked" url:"blocked,omitempty"` - Community Community `json:"community" url:"community,omitempty"` - Counts CommunityAggregates `json:"counts" url:"counts,omitempty"` - Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` -} -type ModAddCommunityView struct { - Community Community `json:"community" url:"community,omitempty"` - ModAddCommunity ModAddCommunity `json:"mod_add_community" url:"mod_add_community,omitempty"` - ModdedPerson Person `json:"modded_person" url:"modded_person,omitempty"` - Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` -} -type GetPersonMentions struct { - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - Sort Optional[CommentSortType] `json:"sort" url:"sort,omitempty"` - UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` -} -type ListingType string - -const ( - ListingTypeAll ListingType = "All" - ListingTypeLocal ListingType = "Local" - ListingTypeSubscribed ListingType = "Subscribed" - ListingTypeModeratorView ListingType = "ModeratorView" -) - -type ModRemovePost struct { - ID int64 `json:"id" url:"id,omitempty"` - ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` - PostID int64 `json:"post_id" url:"post_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type ListRegistrationApplicationsResponse struct { - RegistrationApplications []RegistrationApplicationView `json:"registration_applications" url:"registration_applications,omitempty"` - LemmyResponse -} -type MarkPostAsRead struct { - PostID int64 `json:"post_id" url:"post_id,omitempty"` - Read bool `json:"read" url:"read,omitempty"` -} -type MyUserInfo struct { - CommunityBlocks []CommunityBlockView `json:"community_blocks" url:"community_blocks,omitempty"` - DiscussionLanguages []int64 `json:"discussion_languages" url:"discussion_languages,omitempty"` - Follows []CommunityFollowerView `json:"follows" url:"follows,omitempty"` - InstanceBlocks []InstanceBlockView `json:"instance_blocks" url:"instance_blocks,omitempty"` - LocalUserView LocalUserView `json:"local_user_view" url:"local_user_view,omitempty"` - Moderates []CommunityModeratorView `json:"moderates" url:"moderates,omitempty"` - PersonBlocks []PersonBlockView `json:"person_blocks" url:"person_blocks,omitempty"` + Honeypot Optional[string] `json:"honeypot" url:"honeypot,omitempty"` + LanguageID Optional[int64] `json:"language_id" url:"language_id,omitempty"` + Name string `json:"name" url:"name,omitempty"` + NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` + URL Optional[string] `json:"url" url:"url,omitempty"` } type ModlogActionType string @@ -541,604 +811,43 @@ const ( ModlogActionTypeAdminPurgeComment ModlogActionType = "AdminPurgeComment" ) -type MarkPersonMentionAsRead struct { - PersonMentionID int64 `json:"person_mention_id" url:"person_mention_id,omitempty"` - Read bool `json:"read" url:"read,omitempty"` +type ModAddView struct { + ModAdd ModAdd `json:"mod_add" url:"mod_add,omitempty"` + ModdedPerson Person `json:"modded_person" url:"modded_person,omitempty"` + Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` } -type TransferCommunity struct { - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - PersonID int64 `json:"person_id" url:"person_id,omitempty"` -} -type GetReportCount struct { - CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` -} -type VerifyEmail struct { - Token string `json:"token" url:"token,omitempty"` -} -type CommunityResponse struct { - CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"` - DiscussionLanguages []int64 `json:"discussion_languages" url:"discussion_languages,omitempty"` +type ListRegistrationApplicationsResponse struct { + RegistrationApplications []RegistrationApplicationView `json:"registration_applications" url:"registration_applications,omitempty"` LemmyResponse } -type GetUnreadRegistrationApplicationCountResponse struct { - RegistrationApplications int64 `json:"registration_applications" url:"registration_applications,omitempty"` - LemmyResponse +type SaveComment struct { + CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` + Save bool `json:"save" url:"save,omitempty"` } -type ResolveCommentReport struct { - ReportID int64 `json:"report_id" url:"report_id,omitempty"` - Resolved bool `json:"resolved" url:"resolved,omitempty"` +type CreateCommunity struct { + Banner Optional[string] `json:"banner" url:"banner,omitempty"` + Description Optional[string] `json:"description" url:"description,omitempty"` + DiscussionLanguages Optional[[]int64] `json:"discussion_languages" url:"discussion_languages,omitempty"` + Icon Optional[string] `json:"icon" url:"icon,omitempty"` + Name string `json:"name" url:"name,omitempty"` + NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` + PostingRestrictedToMods Optional[bool] `json:"posting_restricted_to_mods" url:"posting_restricted_to_mods,omitempty"` + Title string `json:"title" url:"title,omitempty"` } -type ResolveObject struct { - Q string `json:"q" url:"q,omitempty"` -} -type PrivateMessageView struct { - Creator Person `json:"creator" url:"creator,omitempty"` - PrivateMessage PrivateMessage `json:"private_message" url:"private_message,omitempty"` - Recipient Person `json:"recipient" url:"recipient,omitempty"` -} -type Register struct { - Answer Optional[string] `json:"answer" url:"answer,omitempty"` - CaptchaAnswer Optional[string] `json:"captcha_answer" url:"captcha_answer,omitempty"` - CaptchaUUID Optional[string] `json:"captcha_uuid" url:"captcha_uuid,omitempty"` - Email Optional[string] `json:"email" url:"email,omitempty"` - Honeypot Optional[string] `json:"honeypot" url:"honeypot,omitempty"` - Password string `json:"password" url:"password,omitempty"` - PasswordVerify string `json:"password_verify" url:"password_verify,omitempty"` - ShowNSFW bool `json:"show_nsfw" url:"show_nsfw,omitempty"` - Username string `json:"username" url:"username,omitempty"` -} -type CreateCustomEmoji struct { - AltText string `json:"alt_text" url:"alt_text,omitempty"` - Category string `json:"category" url:"category,omitempty"` - ImageURL string `json:"image_url" url:"image_url,omitempty"` - Keywords []string `json:"keywords" url:"keywords,omitempty"` - Shortcode string `json:"shortcode" url:"shortcode,omitempty"` -} -type EditPrivateMessage struct { - Content string `json:"content" url:"content,omitempty"` - PrivateMessageID int64 `json:"private_message_id" url:"private_message_id,omitempty"` -} -type ModBanFromCommunity struct { - Banned bool `json:"banned" url:"banned,omitempty"` - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - Expires Optional[string] `json:"expires" url:"expires,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` - OtherPersonID int64 `json:"other_person_id" url:"other_person_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type PasswordReset struct { - Email string `json:"email" url:"email,omitempty"` -} -type Site struct { - ActorID string `json:"actor_id" url:"actor_id,omitempty"` - Banner Optional[string] `json:"banner" url:"banner,omitempty"` - Description Optional[string] `json:"description" url:"description,omitempty"` - Icon Optional[string] `json:"icon" url:"icon,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - InboxURL string `json:"inbox_url" url:"inbox_url,omitempty"` - InstanceID int64 `json:"instance_id" url:"instance_id,omitempty"` - LastRefreshedAt string `json:"last_refreshed_at" url:"last_refreshed_at,omitempty"` - Name string `json:"name" url:"name,omitempty"` - PrivateKey Optional[string] `json:"private_key" url:"private_key,omitempty"` - PublicKey string `json:"public_key" url:"public_key,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Sidebar Optional[string] `json:"sidebar" url:"sidebar,omitempty"` - Updated time.Time `json:"updated" url:"updated,omitempty"` -} -type ModAdd struct { - ID int64 `json:"id" url:"id,omitempty"` - ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` - OtherPersonID int64 `json:"other_person_id" url:"other_person_id,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type ResolvePrivateMessageReport struct { - ReportID int64 `json:"report_id" url:"report_id,omitempty"` - Resolved bool `json:"resolved" url:"resolved,omitempty"` -} -type RegistrationMode string - -const ( - RegistrationModeClosed RegistrationMode = "Closed" - RegistrationModeRequireApplication RegistrationMode = "RequireApplication" - RegistrationModeOpen RegistrationMode = "Open" -) - -type GetComment struct { - ID int64 `json:"id" url:"id,omitempty"` -} -type CommentResponse struct { - CommentView CommentView `json:"comment_view" url:"comment_view,omitempty"` - RecipientIDs []int64 `json:"recipient_ids" url:"recipient_ids,omitempty"` - LemmyResponse -} -type GetModlog struct { - CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - ModPersonID Optional[int64] `json:"mod_person_id" url:"mod_person_id,omitempty"` - OtherPersonID Optional[int64] `json:"other_person_id" url:"other_person_id,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - Type Optional[ModlogActionType] `json:"type_" url:"type_,omitempty"` -} -type GetPostsResponse struct { - NextPage Optional[string] `json:"next_page" url:"next_page,omitempty"` - Posts []PostView `json:"posts" url:"posts,omitempty"` - LemmyResponse -} -type CommentReplyView struct { - Comment Comment `json:"comment" url:"comment,omitempty"` - CommentReply CommentReply `json:"comment_reply" url:"comment_reply,omitempty"` - Community Community `json:"community" url:"community,omitempty"` - Counts CommentAggregates `json:"counts" url:"counts,omitempty"` - Creator Person `json:"creator" url:"creator,omitempty"` - CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` - CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` - MyVote Optional[int64] `json:"my_vote" url:"my_vote,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - Recipient Person `json:"recipient" url:"recipient,omitempty"` - Saved bool `json:"saved" url:"saved,omitempty"` - Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` -} -type LockPost struct { - Locked bool `json:"locked" url:"locked,omitempty"` - PostID int64 `json:"post_id" url:"post_id,omitempty"` -} -type SavePost struct { - PostID int64 `json:"post_id" url:"post_id,omitempty"` - Save bool `json:"save" url:"save,omitempty"` -} -type AddModToCommunityResponse struct { - Moderators []CommunityModeratorView `json:"moderators" url:"moderators,omitempty"` - LemmyResponse -} -type PrivateMessageReport struct { - CreatorID int64 `json:"creator_id" url:"creator_id,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - OriginalPMText string `json:"original_pm_text" url:"original_pm_text,omitempty"` - PrivateMessageID int64 `json:"private_message_id" url:"private_message_id,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Reason string `json:"reason" url:"reason,omitempty"` - Resolved bool `json:"resolved" url:"resolved,omitempty"` - ResolverID Optional[int64] `json:"resolver_id" url:"resolver_id,omitempty"` - Updated time.Time `json:"updated" url:"updated,omitempty"` -} -type AdminPurgeCommunityView struct { - Admin Optional[Person] `json:"admin" url:"admin,omitempty"` - AdminPurgeCommunity AdminPurgeCommunity `json:"admin_purge_community" url:"admin_purge_community,omitempty"` -} -type PersonMentionView struct { - Comment Comment `json:"comment" url:"comment,omitempty"` - Community Community `json:"community" url:"community,omitempty"` - Counts CommentAggregates `json:"counts" url:"counts,omitempty"` - Creator Person `json:"creator" url:"creator,omitempty"` - CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` - CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` - MyVote Optional[int64] `json:"my_vote" url:"my_vote,omitempty"` - PersonMention PersonMention `json:"person_mention" url:"person_mention,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - Recipient Person `json:"recipient" url:"recipient,omitempty"` - Saved bool `json:"saved" url:"saved,omitempty"` - Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` -} -type BanFromCommunity struct { - Ban bool `json:"ban" url:"ban,omitempty"` - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - Expires Optional[int64] `json:"expires" url:"expires,omitempty"` - PersonID int64 `json:"person_id" url:"person_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - RemoveData Optional[bool] `json:"remove_data" url:"remove_data,omitempty"` +type SiteView struct { + Counts SiteAggregates `json:"counts" url:"counts,omitempty"` + LocalSite LocalSite `json:"local_site" url:"local_site,omitempty"` + LocalSiteRateLimit LocalSiteRateLimit `json:"local_site_rate_limit" url:"local_site_rate_limit,omitempty"` + Site Site `json:"site" url:"site,omitempty"` } type ModBanView struct { BannedPerson Person `json:"banned_person" url:"banned_person,omitempty"` ModBan ModBan `json:"mod_ban" url:"mod_ban,omitempty"` Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` } -type CommentReply struct { - CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Read bool `json:"read" url:"read,omitempty"` - RecipientID int64 `json:"recipient_id" url:"recipient_id,omitempty"` -} -type Comment struct { - ApID string `json:"ap_id" url:"ap_id,omitempty"` - Content string `json:"content" url:"content,omitempty"` - CreatorID int64 `json:"creator_id" url:"creator_id,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` - Distinguished bool `json:"distinguished" url:"distinguished,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - LanguageID int64 `json:"language_id" url:"language_id,omitempty"` - Local bool `json:"local" url:"local,omitempty"` - Path string `json:"path" url:"path,omitempty"` - PostID int64 `json:"post_id" url:"post_id,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` - Updated time.Time `json:"updated" url:"updated,omitempty"` -} -type EditCustomEmoji struct { - AltText string `json:"alt_text" url:"alt_text,omitempty"` - Category string `json:"category" url:"category,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - ImageURL string `json:"image_url" url:"image_url,omitempty"` - Keywords []string `json:"keywords" url:"keywords,omitempty"` -} -type CommentReport struct { - CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` - CreatorID int64 `json:"creator_id" url:"creator_id,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - OriginalCommentText string `json:"original_comment_text" url:"original_comment_text,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Reason string `json:"reason" url:"reason,omitempty"` - Resolved bool `json:"resolved" url:"resolved,omitempty"` - ResolverID Optional[int64] `json:"resolver_id" url:"resolver_id,omitempty"` - Updated time.Time `json:"updated" url:"updated,omitempty"` -} -type ListPrivateMessageReportsResponse struct { - PrivateMessageReports []PrivateMessageReportView `json:"private_message_reports" url:"private_message_reports,omitempty"` - LemmyResponse -} -type Community struct { - ActorID string `json:"actor_id" url:"actor_id,omitempty"` - Banner Optional[string] `json:"banner" url:"banner,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` - Description Optional[string] `json:"description" url:"description,omitempty"` - Hidden bool `json:"hidden" url:"hidden,omitempty"` - Icon Optional[string] `json:"icon" url:"icon,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - InstanceID int64 `json:"instance_id" url:"instance_id,omitempty"` - Local bool `json:"local" url:"local,omitempty"` - Name string `json:"name" url:"name,omitempty"` - NSFW bool `json:"nsfw" url:"nsfw,omitempty"` - PostingRestrictedToMods bool `json:"posting_restricted_to_mods" url:"posting_restricted_to_mods,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` - Title string `json:"title" url:"title,omitempty"` - Updated time.Time `json:"updated" url:"updated,omitempty"` -} -type CreatePost struct { - Body Optional[string] `json:"body" url:"body,omitempty"` - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - Honeypot Optional[string] `json:"honeypot" url:"honeypot,omitempty"` - LanguageID Optional[int64] `json:"language_id" url:"language_id,omitempty"` - Name string `json:"name" url:"name,omitempty"` - NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` - URL Optional[string] `json:"url" url:"url,omitempty"` -} -type GetModlogResponse struct { - Added []ModAddView `json:"added" url:"added,omitempty"` - AddedToCommunity []ModAddCommunityView `json:"added_to_community" url:"added_to_community,omitempty"` - AdminPurgedComments []AdminPurgeCommentView `json:"admin_purged_comments" url:"admin_purged_comments,omitempty"` - AdminPurgedCommunities []AdminPurgeCommunityView `json:"admin_purged_communities" url:"admin_purged_communities,omitempty"` - AdminPurgedPersons []AdminPurgePersonView `json:"admin_purged_persons" url:"admin_purged_persons,omitempty"` - AdminPurgedPosts []AdminPurgePostView `json:"admin_purged_posts" url:"admin_purged_posts,omitempty"` - Banned []ModBanView `json:"banned" url:"banned,omitempty"` - BannedFromCommunity []ModBanFromCommunityView `json:"banned_from_community" url:"banned_from_community,omitempty"` - FeaturedPosts []ModFeaturePostView `json:"featured_posts" url:"featured_posts,omitempty"` - HiddenCommunities []ModHideCommunityView `json:"hidden_communities" url:"hidden_communities,omitempty"` - LockedPosts []ModLockPostView `json:"locked_posts" url:"locked_posts,omitempty"` - RemovedComments []ModRemoveCommentView `json:"removed_comments" url:"removed_comments,omitempty"` - RemovedCommunities []ModRemoveCommunityView `json:"removed_communities" url:"removed_communities,omitempty"` - RemovedPosts []ModRemovePostView `json:"removed_posts" url:"removed_posts,omitempty"` - TransferredToCommunity []ModTransferCommunityView `json:"transferred_to_community" url:"transferred_to_community,omitempty"` - LemmyResponse -} -type CommunityModeratorView struct { - Community Community `json:"community" url:"community,omitempty"` - Moderator Person `json:"moderator" url:"moderator,omitempty"` -} -type PurgeComment struct { - CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` -} -type GetUnreadCountResponse struct { - Mentions int64 `json:"mentions" url:"mentions,omitempty"` - PrivateMessages int64 `json:"private_messages" url:"private_messages,omitempty"` - Replies int64 `json:"replies" url:"replies,omitempty"` - LemmyResponse -} -type MarkPrivateMessageAsRead struct { - PrivateMessageID int64 `json:"private_message_id" url:"private_message_id,omitempty"` - Read bool `json:"read" url:"read,omitempty"` -} -type SearchResponse struct { - Comments []CommentView `json:"comments" url:"comments,omitempty"` - Communities []CommunityView `json:"communities" url:"communities,omitempty"` - Posts []PostView `json:"posts" url:"posts,omitempty"` - Type SearchType `json:"type_" url:"type_,omitempty"` - Users []PersonView `json:"users" url:"users,omitempty"` - LemmyResponse -} -type BanPersonResponse struct { - Banned bool `json:"banned" url:"banned,omitempty"` - PersonView PersonView `json:"person_view" url:"person_view,omitempty"` - LemmyResponse -} -type DeleteCommunity struct { - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` -} -type AdminPurgePerson struct { - AdminPersonID int64 `json:"admin_person_id" url:"admin_person_id,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type GetSiteMetadataResponse struct { - Metadata SiteMetadata `json:"metadata" url:"metadata,omitempty"` - LemmyResponse -} -type PostReportResponse struct { - PostReportView PostReportView `json:"post_report_view" url:"post_report_view,omitempty"` - LemmyResponse -} -type LocalSite struct { - ActorNameMaxLength int64 `json:"actor_name_max_length" url:"actor_name_max_length,omitempty"` - ApplicationEmailAdmins bool `json:"application_email_admins" url:"application_email_admins,omitempty"` - ApplicationQuestion Optional[string] `json:"application_question" url:"application_question,omitempty"` - CaptchaDifficulty string `json:"captcha_difficulty" url:"captcha_difficulty,omitempty"` - CaptchaEnabled bool `json:"captcha_enabled" url:"captcha_enabled,omitempty"` - CommunityCreationAdminOnly bool `json:"community_creation_admin_only" url:"community_creation_admin_only,omitempty"` - DefaultPostListingType ListingType `json:"default_post_listing_type" url:"default_post_listing_type,omitempty"` - DefaultTheme string `json:"default_theme" url:"default_theme,omitempty"` - EnableDownvotes bool `json:"enable_downvotes" url:"enable_downvotes,omitempty"` - EnableNSFW bool `json:"enable_nsfw" url:"enable_nsfw,omitempty"` - FederationEnabled bool `json:"federation_enabled" url:"federation_enabled,omitempty"` - HideModlogModNames bool `json:"hide_modlog_mod_names" url:"hide_modlog_mod_names,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - LegalInformation Optional[string] `json:"legal_information" url:"legal_information,omitempty"` - PrivateInstance bool `json:"private_instance" url:"private_instance,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - RegistrationMode RegistrationMode `json:"registration_mode" url:"registration_mode,omitempty"` - ReportsEmailAdmins bool `json:"reports_email_admins" url:"reports_email_admins,omitempty"` - RequireEmailVerification bool `json:"require_email_verification" url:"require_email_verification,omitempty"` - SiteID int64 `json:"site_id" url:"site_id,omitempty"` - SiteSetup bool `json:"site_setup" url:"site_setup,omitempty"` - SlurFilterRegex Optional[string] `json:"slur_filter_regex" url:"slur_filter_regex,omitempty"` - Updated time.Time `json:"updated" url:"updated,omitempty"` -} -type DeleteCustomEmojiResponse struct { - ID int64 `json:"id" url:"id,omitempty"` - Success bool `json:"success" url:"success,omitempty"` - LemmyResponse -} -type PurgePost struct { - PostID int64 `json:"post_id" url:"post_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` -} -type RegistrationApplicationView struct { - Admin Optional[Person] `json:"admin" url:"admin,omitempty"` - Creator Person `json:"creator" url:"creator,omitempty"` - CreatorLocalUser LocalUser `json:"creator_local_user" url:"creator_local_user,omitempty"` - RegistrationApplication RegistrationApplication `json:"registration_application" url:"registration_application,omitempty"` -} -type CommentView struct { - Comment Comment `json:"comment" url:"comment,omitempty"` - Community Community `json:"community" url:"community,omitempty"` - Counts CommentAggregates `json:"counts" url:"counts,omitempty"` - Creator Person `json:"creator" url:"creator,omitempty"` - CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` - CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` - MyVote Optional[int64] `json:"my_vote" url:"my_vote,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - Saved bool `json:"saved" url:"saved,omitempty"` - Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` -} -type CreateCommentReport struct { - CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` - Reason string `json:"reason" url:"reason,omitempty"` -} -type AdminPurgeCommunity struct { - AdminPersonID int64 `json:"admin_person_id" url:"admin_person_id,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type EditComment struct { - CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` - Content Optional[string] `json:"content" url:"content,omitempty"` - LanguageID Optional[int64] `json:"language_id" url:"language_id,omitempty"` -} -type Language struct { - Code string `json:"code" url:"code,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - Name string `json:"name" url:"name,omitempty"` -} -type ListPostReports struct { - CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - UnresolvedOnly Optional[bool] `json:"unresolved_only" url:"unresolved_only,omitempty"` -} -type PasswordChangeAfterReset struct { - Password string `json:"password" url:"password,omitempty"` - PasswordVerify string `json:"password_verify" url:"password_verify,omitempty"` - Token string `json:"token" url:"token,omitempty"` -} -type CommentReportResponse struct { - CommentReportView CommentReportView `json:"comment_report_view" url:"comment_report_view,omitempty"` - LemmyResponse -} -type GetCaptchaResponse struct { - Ok Optional[CaptchaResponse] `json:"ok" url:"ok,omitempty"` - LemmyResponse -} -type CommunityBlockView struct { - Community Community `json:"community" url:"community,omitempty"` - Person Person `json:"person" url:"person,omitempty"` -} -type PurgeItemResponse struct { - Success bool `json:"success" url:"success,omitempty"` - LemmyResponse -} -type GetComments struct { - CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` - CommunityName Optional[string] `json:"community_name" url:"community_name,omitempty"` - DislikedOnly Optional[bool] `json:"disliked_only" url:"disliked_only,omitempty"` - LikedOnly Optional[bool] `json:"liked_only" url:"liked_only,omitempty"` - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - MaxDepth Optional[int64] `json:"max_depth" url:"max_depth,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - ParentID Optional[int64] `json:"parent_id" url:"parent_id,omitempty"` - PostID Optional[int64] `json:"post_id" url:"post_id,omitempty"` - SavedOnly Optional[bool] `json:"saved_only" url:"saved_only,omitempty"` - Sort Optional[CommentSortType] `json:"sort" url:"sort,omitempty"` - Type Optional[ListingType] `json:"type_" url:"type_,omitempty"` -} -type ListCommentReports struct { - CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - UnresolvedOnly Optional[bool] `json:"unresolved_only" url:"unresolved_only,omitempty"` -} -type ListPrivateMessageReports struct { - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - UnresolvedOnly Optional[bool] `json:"unresolved_only" url:"unresolved_only,omitempty"` -} -type SearchType string - -const ( - SearchTypeAll SearchType = "All" - SearchTypeComments SearchType = "Comments" - SearchTypePosts SearchType = "Posts" - SearchTypeCommunities SearchType = "Communities" - SearchTypeUsers SearchType = "Users" - SearchTypeUrl SearchType = "Url" -) - -type BlockInstanceResponse struct { - Blocked bool `json:"blocked" url:"blocked,omitempty"` - LemmyResponse -} -type CreatePostReport struct { - PostID int64 `json:"post_id" url:"post_id,omitempty"` - Reason string `json:"reason" url:"reason,omitempty"` -} -type CreatePrivateMessage struct { - Content string `json:"content" url:"content,omitempty"` - RecipientID int64 `json:"recipient_id" url:"recipient_id,omitempty"` -} -type PostFeatureType string - -const ( - PostFeatureTypeLocal PostFeatureType = "Local" - PostFeatureTypeCommunity PostFeatureType = "Community" -) - -type PostResponse struct { - PostView PostView `json:"post_view" url:"post_view,omitempty"` - LemmyResponse -} -type FeaturePost struct { - FeatureType PostFeatureType `json:"feature_type" url:"feature_type,omitempty"` - Featured bool `json:"featured" url:"featured,omitempty"` - PostID int64 `json:"post_id" url:"post_id,omitempty"` -} -type InstanceBlockView struct { - Instance Instance `json:"instance" url:"instance,omitempty"` - Person Person `json:"person" url:"person,omitempty"` - Site Optional[Site] `json:"site" url:"site,omitempty"` -} -type CustomEmoji struct { - AltText string `json:"alt_text" url:"alt_text,omitempty"` - Category string `json:"category" url:"category,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - ImageURL string `json:"image_url" url:"image_url,omitempty"` - LocalSiteID int64 `json:"local_site_id" url:"local_site_id,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Shortcode string `json:"shortcode" url:"shortcode,omitempty"` - Updated time.Time `json:"updated" url:"updated,omitempty"` -} -type EditPost struct { - Body Optional[string] `json:"body" url:"body,omitempty"` - LanguageID Optional[int64] `json:"language_id" url:"language_id,omitempty"` - Name Optional[string] `json:"name" url:"name,omitempty"` - NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` - PostID int64 `json:"post_id" url:"post_id,omitempty"` - URL Optional[string] `json:"url" url:"url,omitempty"` -} -type ModFeaturePostView struct { - Community Community `json:"community" url:"community,omitempty"` - ModFeaturePost ModFeaturePost `json:"mod_feature_post" url:"mod_feature_post,omitempty"` - Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` - Post Post `json:"post" url:"post,omitempty"` -} -type ModTransferCommunity struct { - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` - OtherPersonID int64 `json:"other_person_id" url:"other_person_id,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type ModLockPostView struct { - Community Community `json:"community" url:"community,omitempty"` - ModLockPost ModLockPost `json:"mod_lock_post" url:"mod_lock_post,omitempty"` - Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` - Post Post `json:"post" url:"post,omitempty"` -} -type LocalUserView struct { - Counts PersonAggregates `json:"counts" url:"counts,omitempty"` - LocalUser LocalUser `json:"local_user" url:"local_user,omitempty"` - Person Person `json:"person" url:"person,omitempty"` -} -type ListRegistrationApplications struct { - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` -} -type ModBanFromCommunityView struct { - BannedPerson Person `json:"banned_person" url:"banned_person,omitempty"` - Community Community `json:"community" url:"community,omitempty"` - ModBanFromCommunity ModBanFromCommunity `json:"mod_ban_from_community" url:"mod_ban_from_community,omitempty"` - Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` -} -type CreatePostLike struct { - PostID int64 `json:"post_id" url:"post_id,omitempty"` - Score int64 `json:"score" url:"score,omitempty"` -} -type CommunityAggregates struct { - Comments int64 `json:"comments" url:"comments,omitempty"` - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - HotRank float64 `json:"hot_rank" url:"hot_rank,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - Posts int64 `json:"posts" url:"posts,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Subscribers int64 `json:"subscribers" url:"subscribers,omitempty"` - UsersActiveDay int64 `json:"users_active_day" url:"users_active_day,omitempty"` - UsersActiveHalfYear int64 `json:"users_active_half_year" url:"users_active_half_year,omitempty"` - UsersActiveMonth int64 `json:"users_active_month" url:"users_active_month,omitempty"` - UsersActiveWeek int64 `json:"users_active_week" url:"users_active_week,omitempty"` -} -type PostReportView struct { - Community Community `json:"community" url:"community,omitempty"` - Counts PostAggregates `json:"counts" url:"counts,omitempty"` - Creator Person `json:"creator" url:"creator,omitempty"` - CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` - MyVote Optional[int64] `json:"my_vote" url:"my_vote,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - PostCreator Person `json:"post_creator" url:"post_creator,omitempty"` - PostReport PostReport `json:"post_report" url:"post_report,omitempty"` - Resolver Optional[Person] `json:"resolver" url:"resolver,omitempty"` -} -type LocalSiteRateLimit struct { - Comment int64 `json:"comment" url:"comment,omitempty"` - CommentPerSecond int64 `json:"comment_per_second" url:"comment_per_second,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - Image int64 `json:"image" url:"image,omitempty"` - ImagePerSecond int64 `json:"image_per_second" url:"image_per_second,omitempty"` - LocalSiteID int64 `json:"local_site_id" url:"local_site_id,omitempty"` - Message int64 `json:"message" url:"message,omitempty"` - MessagePerSecond int64 `json:"message_per_second" url:"message_per_second,omitempty"` - Post int64 `json:"post" url:"post,omitempty"` - PostPerSecond int64 `json:"post_per_second" url:"post_per_second,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Register int64 `json:"register" url:"register,omitempty"` - RegisterPerSecond int64 `json:"register_per_second" url:"register_per_second,omitempty"` - Search int64 `json:"search" url:"search,omitempty"` - SearchPerSecond int64 `json:"search_per_second" url:"search_per_second,omitempty"` - Updated time.Time `json:"updated" url:"updated,omitempty"` +type MarkCommentReplyAsRead struct { + CommentReplyID int64 `json:"comment_reply_id" url:"comment_reply_id,omitempty"` + Read bool `json:"read" url:"read,omitempty"` } type PostReport struct { CreatorID int64 `json:"creator_id" url:"creator_id,omitempty"` @@ -1153,67 +862,15 @@ type PostReport struct { ResolverID Optional[int64] `json:"resolver_id" url:"resolver_id,omitempty"` Updated time.Time `json:"updated" url:"updated,omitempty"` } -type SiteResponse struct { - SiteView SiteView `json:"site_view" url:"site_view,omitempty"` - Taglines []Tagline `json:"taglines" url:"taglines,omitempty"` - LemmyResponse -} -type GetPersonDetailsResponse struct { - Comments []CommentView `json:"comments" url:"comments,omitempty"` - Moderates []CommunityModeratorView `json:"moderates" url:"moderates,omitempty"` - PersonView PersonView `json:"person_view" url:"person_view,omitempty"` - Posts []PostView `json:"posts" url:"posts,omitempty"` - LemmyResponse -} -type ApproveRegistrationApplication struct { - Approve bool `json:"approve" url:"approve,omitempty"` - DenyReason Optional[string] `json:"deny_reason" url:"deny_reason,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` +type PrivateMessageView struct { + Creator Person `json:"creator" url:"creator,omitempty"` + PrivateMessage PrivateMessage `json:"private_message" url:"private_message,omitempty"` + Recipient Person `json:"recipient" url:"recipient,omitempty"` } type DistinguishComment struct { CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` Distinguished bool `json:"distinguished" url:"distinguished,omitempty"` } -type FollowCommunity struct { - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - Follow bool `json:"follow" url:"follow,omitempty"` -} -type CaptchaResponse struct { - PNG string `json:"png" url:"png,omitempty"` - UUID string `json:"uuid" url:"uuid,omitempty"` - WAV string `json:"wav" url:"wav,omitempty"` - LemmyResponse -} -type SiteMetadata struct { - Description Optional[string] `json:"description" url:"description,omitempty"` - EmbedVideoURL Optional[string] `json:"embed_video_url" url:"embed_video_url,omitempty"` - Image Optional[string] `json:"image" url:"image,omitempty"` - Title Optional[string] `json:"title" url:"title,omitempty"` -} -type ModAddView struct { - ModAdd ModAdd `json:"mod_add" url:"mod_add,omitempty"` - ModdedPerson Person `json:"modded_person" url:"modded_person,omitempty"` - Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` -} -type ModRemoveCommunity struct { - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - Expires Optional[string] `json:"expires" url:"expires,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type GetReplies struct { - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - Sort Optional[CommentSortType] `json:"sort" url:"sort,omitempty"` - UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` -} -type ListCommunitiesResponse struct { - Communities []CommunityView `json:"communities" url:"communities,omitempty"` - LemmyResponse -} type EditSite struct { ActorNameMaxLength Optional[int64] `json:"actor_name_max_length" url:"actor_name_max_length,omitempty"` AllowedInstances Optional[[]string] `json:"allowed_instances" url:"allowed_instances,omitempty"` @@ -1256,129 +913,194 @@ type EditSite struct { SlurFilterRegex Optional[string] `json:"slur_filter_regex" url:"slur_filter_regex,omitempty"` Taglines Optional[[]string] `json:"taglines" url:"taglines,omitempty"` } -type AdminPurgePostView struct { - Admin Optional[Person] `json:"admin" url:"admin,omitempty"` - AdminPurgePost AdminPurgePost `json:"admin_purge_post" url:"admin_purge_post,omitempty"` - Community Community `json:"community" url:"community,omitempty"` +type PostFeatureType string + +const ( + PostFeatureTypeLocal PostFeatureType = "Local" + PostFeatureTypeCommunity PostFeatureType = "Community" +) + +type BanPersonResponse struct { + Banned bool `json:"banned" url:"banned,omitempty"` + PersonView PersonView `json:"person_view" url:"person_view,omitempty"` + LemmyResponse +} +type LoginResponse struct { + JWT Optional[string] `json:"jwt" url:"jwt,omitempty"` + RegistrationCreated bool `json:"registration_created" url:"registration_created,omitempty"` + VerifyEmailSent bool `json:"verify_email_sent" url:"verify_email_sent,omitempty"` + LemmyResponse +} +type PostView struct { + Community Community `json:"community" url:"community,omitempty"` + Counts PostAggregates `json:"counts" url:"counts,omitempty"` + Creator Person `json:"creator" url:"creator,omitempty"` + CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` + CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` + MyVote Optional[int64] `json:"my_vote" url:"my_vote,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Read bool `json:"read" url:"read,omitempty"` + Saved bool `json:"saved" url:"saved,omitempty"` + Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` + UnreadComments int64 `json:"unread_comments" url:"unread_comments,omitempty"` +} +type ModTransferCommunity struct { + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` + OtherPersonID int64 `json:"other_person_id" url:"other_person_id,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` } type CustomEmojiResponse struct { CustomEmoji CustomEmojiView `json:"custom_emoji" url:"custom_emoji,omitempty"` LemmyResponse } -type GetPrivateMessages struct { - CreatorID Optional[int64] `json:"creator_id" url:"creator_id,omitempty"` - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` -} -type GetRepliesResponse struct { - Replies []CommentReplyView `json:"replies" url:"replies,omitempty"` +type GetPostsResponse struct { + NextPage Optional[string] `json:"next_page" url:"next_page,omitempty"` + Posts []PostView `json:"posts" url:"posts,omitempty"` LemmyResponse } -type ModFeaturePost struct { - Featured bool `json:"featured" url:"featured,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - IsFeaturedCommunity bool `json:"is_featured_community" url:"is_featured_community,omitempty"` - ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` - PostID int64 `json:"post_id" url:"post_id,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type ChangePassword struct { - NewPassword string `json:"new_password" url:"new_password,omitempty"` - NewPasswordVerify string `json:"new_password_verify" url:"new_password_verify,omitempty"` - OldPassword string `json:"old_password" url:"old_password,omitempty"` -} -type CommentReportView struct { - Comment Comment `json:"comment" url:"comment,omitempty"` - CommentCreator Person `json:"comment_creator" url:"comment_creator,omitempty"` - CommentReport CommentReport `json:"comment_report" url:"comment_report,omitempty"` - Community Community `json:"community" url:"community,omitempty"` - Counts CommentAggregates `json:"counts" url:"counts,omitempty"` - Creator Person `json:"creator" url:"creator,omitempty"` - CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` - MyVote Optional[int64] `json:"my_vote" url:"my_vote,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - Resolver Optional[Person] `json:"resolver" url:"resolver,omitempty"` -} -type SiteView struct { - Counts SiteAggregates `json:"counts" url:"counts,omitempty"` - LocalSite LocalSite `json:"local_site" url:"local_site,omitempty"` - LocalSiteRateLimit LocalSiteRateLimit `json:"local_site_rate_limit" url:"local_site_rate_limit,omitempty"` - Site Site `json:"site" url:"site,omitempty"` -} -type AdminPurgePersonView struct { - Admin Optional[Person] `json:"admin" url:"admin,omitempty"` - AdminPurgePerson AdminPurgePerson `json:"admin_purge_person" url:"admin_purge_person,omitempty"` -} -type AddModToCommunity struct { - Added bool `json:"added" url:"added,omitempty"` - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - PersonID int64 `json:"person_id" url:"person_id,omitempty"` +type LockPost struct { + Locked bool `json:"locked" url:"locked,omitempty"` + PostID int64 `json:"post_id" url:"post_id,omitempty"` } type PrivateMessageResponse struct { PrivateMessageView PrivateMessageView `json:"private_message_view" url:"private_message_view,omitempty"` LemmyResponse } -type ListPostReportsResponse struct { - PostReports []PostReportView `json:"post_reports" url:"post_reports,omitempty"` +type AddModToCommunityResponse struct { + Moderators []CommunityModeratorView `json:"moderators" url:"moderators,omitempty"` LemmyResponse } -type RegistrationApplication struct { - AdminID Optional[int64] `json:"admin_id" url:"admin_id,omitempty"` - Answer string `json:"answer" url:"answer,omitempty"` - DenyReason Optional[string] `json:"deny_reason" url:"deny_reason,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - LocalUserID int64 `json:"local_user_id" url:"local_user_id,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` -} -type ModRemoveCommentView struct { - Comment Comment `json:"comment" url:"comment,omitempty"` - Commenter Person `json:"commenter" url:"commenter,omitempty"` - Community Community `json:"community" url:"community,omitempty"` - ModRemoveComment ModRemoveComment `json:"mod_remove_comment" url:"mod_remove_comment,omitempty"` - Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` - Post Post `json:"post" url:"post,omitempty"` -} -type GetPersonMentionsResponse struct { - Mentions []PersonMentionView `json:"mentions" url:"mentions,omitempty"` - LemmyResponse -} -type GetPersonDetails struct { - CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - PersonID Optional[int64] `json:"person_id" url:"person_id,omitempty"` - SavedOnly Optional[bool] `json:"saved_only" url:"saved_only,omitempty"` - Sort Optional[SortType] `json:"sort" url:"sort,omitempty"` - Username Optional[string] `json:"username" url:"username,omitempty"` -} -type PersonMention struct { - CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Read bool `json:"read" url:"read,omitempty"` - RecipientID int64 `json:"recipient_id" url:"recipient_id,omitempty"` -} -type AddAdmin struct { - Added bool `json:"added" url:"added,omitempty"` - PersonID int64 `json:"person_id" url:"person_id,omitempty"` -} -type BlockCommunityResponse struct { - Blocked bool `json:"blocked" url:"blocked,omitempty"` - CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"` - LemmyResponse -} -type SubscribedType string +type PostListingMode string const ( - SubscribedTypeSubscribed SubscribedType = "Subscribed" - SubscribedTypeNotSubscribed SubscribedType = "NotSubscribed" - SubscribedTypePending SubscribedType = "Pending" + PostListingModeList PostListingMode = "List" + PostListingModeCard PostListingMode = "Card" + PostListingModeSmallCard PostListingMode = "SmallCard" ) -type DeleteAccount struct { - DeleteContent bool `json:"delete_content" url:"delete_content,omitempty"` - Password string `json:"password" url:"password,omitempty"` +type CommentAggregates struct { + ChildCount int64 `json:"child_count" url:"child_count,omitempty"` + CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` + ControversyRank float64 `json:"controversy_rank" url:"controversy_rank,omitempty"` + Downvotes int64 `json:"downvotes" url:"downvotes,omitempty"` + HotRank float64 `json:"hot_rank" url:"hot_rank,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Score int64 `json:"score" url:"score,omitempty"` + Upvotes int64 `json:"upvotes" url:"upvotes,omitempty"` +} +type PurgePost struct { + PostID int64 `json:"post_id" url:"post_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` +} +type ModRemoveComment struct { + CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + Removed bool `json:"removed" url:"removed,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` +} +type GetUnreadCountResponse struct { + Mentions int64 `json:"mentions" url:"mentions,omitempty"` + PrivateMessages int64 `json:"private_messages" url:"private_messages,omitempty"` + Replies int64 `json:"replies" url:"replies,omitempty"` + LemmyResponse +} +type Login struct { + Password string `json:"password" url:"password,omitempty"` + TOTP2FAToken Optional[string] `json:"totp_2fa_token" url:"totp_2fa_token,omitempty"` + UsernameOrEmail string `json:"username_or_email" url:"username_or_email,omitempty"` +} +type CommunityModeratorView struct { + Community Community `json:"community" url:"community,omitempty"` + Moderator Person `json:"moderator" url:"moderator,omitempty"` +} +type CommentSortType string + +const ( + CommentSortTypeHot CommentSortType = "Hot" + CommentSortTypeTop CommentSortType = "Top" + CommentSortTypeNew CommentSortType = "New" + CommentSortTypeOld CommentSortType = "Old" + CommentSortTypeControversial CommentSortType = "Controversial" +) + +type BlockInstanceResponse struct { + Blocked bool `json:"blocked" url:"blocked,omitempty"` + LemmyResponse +} +type AdminPurgePostView struct { + Admin Optional[Person] `json:"admin" url:"admin,omitempty"` + AdminPurgePost AdminPurgePost `json:"admin_purge_post" url:"admin_purge_post,omitempty"` + Community Community `json:"community" url:"community,omitempty"` +} +type SearchType string + +const ( + SearchTypeAll SearchType = "All" + SearchTypeComments SearchType = "Comments" + SearchTypePosts SearchType = "Posts" + SearchTypeCommunities SearchType = "Communities" + SearchTypeUsers SearchType = "Users" + SearchTypeUrl SearchType = "Url" +) + +type InstanceBlockView struct { + Instance Instance `json:"instance" url:"instance,omitempty"` + Person Person `json:"person" url:"person,omitempty"` + Site Optional[Site] `json:"site" url:"site,omitempty"` +} +type Search struct { + CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` + CommunityName Optional[string] `json:"community_name" url:"community_name,omitempty"` + CreatorID Optional[int64] `json:"creator_id" url:"creator_id,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + ListingType Optional[ListingType] `json:"listing_type" url:"listing_type,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + Q string `json:"q" url:"q,omitempty"` + Sort Optional[SortType] `json:"sort" url:"sort,omitempty"` + Type Optional[SearchType] `json:"type_" url:"type_,omitempty"` +} +type PersonMentionView struct { + Comment Comment `json:"comment" url:"comment,omitempty"` + Community Community `json:"community" url:"community,omitempty"` + Counts CommentAggregates `json:"counts" url:"counts,omitempty"` + Creator Person `json:"creator" url:"creator,omitempty"` + CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` + CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` + MyVote Optional[int64] `json:"my_vote" url:"my_vote,omitempty"` + PersonMention PersonMention `json:"person_mention" url:"person_mention,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Recipient Person `json:"recipient" url:"recipient,omitempty"` + Saved bool `json:"saved" url:"saved,omitempty"` + Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` +} +type HideCommunity struct { + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + Hidden bool `json:"hidden" url:"hidden,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` +} +type PasswordChangeAfterReset struct { + Password string `json:"password" url:"password,omitempty"` + PasswordVerify string `json:"password_verify" url:"password_verify,omitempty"` + Token string `json:"token" url:"token,omitempty"` +} +type ListCommentReports struct { + CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + UnresolvedOnly Optional[bool] `json:"unresolved_only" url:"unresolved_only,omitempty"` +} +type ListCommunitiesResponse struct { + Communities []CommunityView `json:"communities" url:"communities,omitempty"` + LemmyResponse +} +type MarkPersonMentionAsRead struct { + PersonMentionID int64 `json:"person_mention_id" url:"person_mention_id,omitempty"` + Read bool `json:"read" url:"read,omitempty"` } type SortType string @@ -1404,52 +1126,143 @@ const ( SortTypeScaled SortType = "Scaled" ) -type ModHideCommunity struct { - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - Hidden bool `json:"hidden" url:"hidden,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type ModLockPost struct { - ID int64 `json:"id" url:"id,omitempty"` - Locked bool `json:"locked" url:"locked,omitempty"` - ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` - PostID int64 `json:"post_id" url:"post_id,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type CreateCommentLike struct { - CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` - Score int64 `json:"score" url:"score,omitempty"` -} -type AdminPurgeCommentView struct { - Admin Optional[Person] `json:"admin" url:"admin,omitempty"` - AdminPurgeComment AdminPurgeComment `json:"admin_purge_comment" url:"admin_purge_comment,omitempty"` - Post Post `json:"post" url:"post,omitempty"` -} -type ModTransferCommunityView struct { - Community Community `json:"community" url:"community,omitempty"` - ModTransferCommunity ModTransferCommunity `json:"mod_transfer_community" url:"mod_transfer_community,omitempty"` - ModdedPerson Person `json:"modded_person" url:"modded_person,omitempty"` - Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` -} -type BanPerson struct { - Ban bool `json:"ban" url:"ban,omitempty"` - Expires Optional[int64] `json:"expires" url:"expires,omitempty"` - PersonID int64 `json:"person_id" url:"person_id,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - RemoveData Optional[bool] `json:"remove_data" url:"remove_data,omitempty"` -} type CreateComment struct { Content string `json:"content" url:"content,omitempty"` LanguageID Optional[int64] `json:"language_id" url:"language_id,omitempty"` ParentID Optional[int64] `json:"parent_id" url:"parent_id,omitempty"` PostID int64 `json:"post_id" url:"post_id,omitempty"` } -type DeleteCustomEmoji struct { +type ModAddCommunity struct { + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` + OtherPersonID int64 `json:"other_person_id" url:"other_person_id,omitempty"` + Removed bool `json:"removed" url:"removed,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` +} +type SaveUserSettings struct { + AutoExpand Optional[bool] `json:"auto_expand" url:"auto_expand,omitempty"` + Avatar Optional[string] `json:"avatar" url:"avatar,omitempty"` + Banner Optional[string] `json:"banner" url:"banner,omitempty"` + Bio Optional[string] `json:"bio" url:"bio,omitempty"` + BlurNSFW Optional[bool] `json:"blur_nsfw" url:"blur_nsfw,omitempty"` + BotAccount Optional[bool] `json:"bot_account" url:"bot_account,omitempty"` + DefaultListingType Optional[ListingType] `json:"default_listing_type" url:"default_listing_type,omitempty"` + DefaultSortType Optional[SortType] `json:"default_sort_type" url:"default_sort_type,omitempty"` + DiscussionLanguages Optional[[]int64] `json:"discussion_languages" url:"discussion_languages,omitempty"` + DisplayName Optional[string] `json:"display_name" url:"display_name,omitempty"` + Email Optional[string] `json:"email" url:"email,omitempty"` + InfiniteScrollEnabled Optional[bool] `json:"infinite_scroll_enabled" url:"infinite_scroll_enabled,omitempty"` + InterfaceLanguage Optional[string] `json:"interface_language" url:"interface_language,omitempty"` + MatrixUserID Optional[string] `json:"matrix_user_id" url:"matrix_user_id,omitempty"` + OpenLinksInNewTab Optional[bool] `json:"open_links_in_new_tab" url:"open_links_in_new_tab,omitempty"` + SendNotificationsToEmail Optional[bool] `json:"send_notifications_to_email" url:"send_notifications_to_email,omitempty"` + ShowAvatars Optional[bool] `json:"show_avatars" url:"show_avatars,omitempty"` + ShowBotAccounts Optional[bool] `json:"show_bot_accounts" url:"show_bot_accounts,omitempty"` + ShowNewPostNotifs Optional[bool] `json:"show_new_post_notifs" url:"show_new_post_notifs,omitempty"` + ShowNSFW Optional[bool] `json:"show_nsfw" url:"show_nsfw,omitempty"` + ShowReadPosts Optional[bool] `json:"show_read_posts" url:"show_read_posts,omitempty"` + ShowScores Optional[bool] `json:"show_scores" url:"show_scores,omitempty"` + Theme Optional[string] `json:"theme" url:"theme,omitempty"` +} +type SearchResponse struct { + Comments []CommentView `json:"comments" url:"comments,omitempty"` + Communities []CommunityView `json:"communities" url:"communities,omitempty"` + Posts []PostView `json:"posts" url:"posts,omitempty"` + Type SearchType `json:"type_" url:"type_,omitempty"` + Users []PersonView `json:"users" url:"users,omitempty"` + LemmyResponse +} +type CustomEmojiView struct { + CustomEmoji CustomEmoji `json:"custom_emoji" url:"custom_emoji,omitempty"` + Keywords []CustomEmojiKeyword `json:"keywords" url:"keywords,omitempty"` +} +type CustomEmoji struct { + AltText string `json:"alt_text" url:"alt_text,omitempty"` + Category string `json:"category" url:"category,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + ImageURL string `json:"image_url" url:"image_url,omitempty"` + LocalSiteID int64 `json:"local_site_id" url:"local_site_id,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Shortcode string `json:"shortcode" url:"shortcode,omitempty"` + Updated time.Time `json:"updated" url:"updated,omitempty"` +} +type GetFederatedInstancesResponse struct { + FederatedInstances Optional[FederatedInstances] `json:"federated_instances" url:"federated_instances,omitempty"` + LemmyResponse +} +type AdminPurgePost struct { + AdminPersonID int64 `json:"admin_person_id" url:"admin_person_id,omitempty"` + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` +} +type ModFeaturePostView struct { + Community Community `json:"community" url:"community,omitempty"` + ModFeaturePost ModFeaturePost `json:"mod_feature_post" url:"mod_feature_post,omitempty"` + Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` + Post Post `json:"post" url:"post,omitempty"` +} +type LocalUserView struct { + Counts PersonAggregates `json:"counts" url:"counts,omitempty"` + LocalUser LocalUser `json:"local_user" url:"local_user,omitempty"` + Person Person `json:"person" url:"person,omitempty"` +} +type PurgeCommunity struct { + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` +} +type BlockPerson struct { + Block bool `json:"block" url:"block,omitempty"` + PersonID int64 `json:"person_id" url:"person_id,omitempty"` +} +type GetComment struct { ID int64 `json:"id" url:"id,omitempty"` } +type ModAddCommunityView struct { + Community Community `json:"community" url:"community,omitempty"` + ModAddCommunity ModAddCommunity `json:"mod_add_community" url:"mod_add_community,omitempty"` + ModdedPerson Person `json:"modded_person" url:"modded_person,omitempty"` + Moderator Optional[Person] `json:"moderator" url:"moderator,omitempty"` +} +type AdminPurgeCommentView struct { + Admin Optional[Person] `json:"admin" url:"admin,omitempty"` + AdminPurgeComment AdminPurgeComment `json:"admin_purge_comment" url:"admin_purge_comment,omitempty"` + Post Post `json:"post" url:"post,omitempty"` +} +type ModRemovePost struct { + ID int64 `json:"id" url:"id,omitempty"` + ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` + PostID int64 `json:"post_id" url:"post_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + Removed bool `json:"removed" url:"removed,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` +} +type PersonMentionResponse struct { + PersonMentionView PersonMentionView `json:"person_mention_view" url:"person_mention_view,omitempty"` + LemmyResponse +} +type CommunityAggregates struct { + Comments int64 `json:"comments" url:"comments,omitempty"` + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + HotRank float64 `json:"hot_rank" url:"hot_rank,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + Posts int64 `json:"posts" url:"posts,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Subscribers int64 `json:"subscribers" url:"subscribers,omitempty"` + UsersActiveDay int64 `json:"users_active_day" url:"users_active_day,omitempty"` + UsersActiveHalfYear int64 `json:"users_active_half_year" url:"users_active_half_year,omitempty"` + UsersActiveMonth int64 `json:"users_active_month" url:"users_active_month,omitempty"` + UsersActiveWeek int64 `json:"users_active_week" url:"users_active_week,omitempty"` +} +type Tagline struct { + Content string `json:"content" url:"content,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + LocalSiteID int64 `json:"local_site_id" url:"local_site_id,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Updated time.Time `json:"updated" url:"updated,omitempty"` +} type GetCommunityResponse struct { CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"` DiscussionLanguages []int64 `json:"discussion_languages" url:"discussion_languages,omitempty"` @@ -1457,6 +1270,93 @@ type GetCommunityResponse struct { Site Optional[Site] `json:"site" url:"site,omitempty"` LemmyResponse } +type ListCommentReportsResponse struct { + CommentReports []CommentReportView `json:"comment_reports" url:"comment_reports,omitempty"` + LemmyResponse +} +type Comment struct { + ApID string `json:"ap_id" url:"ap_id,omitempty"` + Content string `json:"content" url:"content,omitempty"` + CreatorID int64 `json:"creator_id" url:"creator_id,omitempty"` + Deleted bool `json:"deleted" url:"deleted,omitempty"` + Distinguished bool `json:"distinguished" url:"distinguished,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + LanguageID int64 `json:"language_id" url:"language_id,omitempty"` + Local bool `json:"local" url:"local,omitempty"` + Path string `json:"path" url:"path,omitempty"` + PostID int64 `json:"post_id" url:"post_id,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Removed bool `json:"removed" url:"removed,omitempty"` + Updated time.Time `json:"updated" url:"updated,omitempty"` +} +type PostResponse struct { + PostView PostView `json:"post_view" url:"post_view,omitempty"` + LemmyResponse +} +type ModAdd struct { + ID int64 `json:"id" url:"id,omitempty"` + ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` + OtherPersonID int64 `json:"other_person_id" url:"other_person_id,omitempty"` + Removed bool `json:"removed" url:"removed,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` +} +type ModBan struct { + Banned bool `json:"banned" url:"banned,omitempty"` + Expires Optional[string] `json:"expires" url:"expires,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` + OtherPersonID int64 `json:"other_person_id" url:"other_person_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` +} +type GetReportCountResponse struct { + CommentReports int64 `json:"comment_reports" url:"comment_reports,omitempty"` + CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` + PostReports int64 `json:"post_reports" url:"post_reports,omitempty"` + PrivateMessageReports Optional[int64] `json:"private_message_reports" url:"private_message_reports,omitempty"` + LemmyResponse +} +type MarkPostAsRead struct { + PostID int64 `json:"post_id" url:"post_id,omitempty"` + Read bool `json:"read" url:"read,omitempty"` +} +type ResolveObjectResponse struct { + Comment Optional[CommentView] `json:"comment" url:"comment,omitempty"` + Community Optional[CommunityView] `json:"community" url:"community,omitempty"` + Person Optional[PersonView] `json:"person" url:"person,omitempty"` + Post Optional[PostView] `json:"post" url:"post,omitempty"` + LemmyResponse +} +type CommunityView struct { + Blocked bool `json:"blocked" url:"blocked,omitempty"` + Community Community `json:"community" url:"community,omitempty"` + Counts CommunityAggregates `json:"counts" url:"counts,omitempty"` + Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` +} +type CustomEmojiKeyword struct { + CustomEmojiID int64 `json:"custom_emoji_id" url:"custom_emoji_id,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + Keyword string `json:"keyword" url:"keyword,omitempty"` +} +type AdminPurgeComment struct { + AdminPersonID int64 `json:"admin_person_id" url:"admin_person_id,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + PostID int64 `json:"post_id" url:"post_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` +} +type AdminPurgeCommunity struct { + AdminPersonID int64 `json:"admin_person_id" url:"admin_person_id,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` +} +type GetReplies struct { + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + Sort Optional[CommentSortType] `json:"sort" url:"sort,omitempty"` + UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` +} type PersonAggregates struct { CommentCount int64 `json:"comment_count" url:"comment_count,omitempty"` CommentScore int64 `json:"comment_score" url:"comment_score,omitempty"` @@ -1465,84 +1365,184 @@ type PersonAggregates struct { PostCount int64 `json:"post_count" url:"post_count,omitempty"` PostScore int64 `json:"post_score" url:"post_score,omitempty"` } -type CommentAggregates struct { - ChildCount int64 `json:"child_count" url:"child_count,omitempty"` - CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` - ControversyRank float64 `json:"controversy_rank" url:"controversy_rank,omitempty"` - Downvotes int64 `json:"downvotes" url:"downvotes,omitempty"` - HotRank float64 `json:"hot_rank" url:"hot_rank,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Score int64 `json:"score" url:"score,omitempty"` - Upvotes int64 `json:"upvotes" url:"upvotes,omitempty"` +type ModBanFromCommunity struct { + Banned bool `json:"banned" url:"banned,omitempty"` + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + Expires Optional[string] `json:"expires" url:"expires,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` + OtherPersonID int64 `json:"other_person_id" url:"other_person_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` } -type PrivateMessage struct { - ApID string `json:"ap_id" url:"ap_id,omitempty"` - Content string `json:"content" url:"content,omitempty"` - CreatorID int64 `json:"creator_id" url:"creator_id,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` +type ModLockPost struct { + ID int64 `json:"id" url:"id,omitempty"` + Locked bool `json:"locked" url:"locked,omitempty"` + ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` + PostID int64 `json:"post_id" url:"post_id,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` +} +type ChangePassword struct { + NewPassword string `json:"new_password" url:"new_password,omitempty"` + NewPasswordVerify string `json:"new_password_verify" url:"new_password_verify,omitempty"` + OldPassword string `json:"old_password" url:"old_password,omitempty"` +} +type PersonMention struct { + CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` ID int64 `json:"id" url:"id,omitempty"` - Local bool `json:"local" url:"local,omitempty"` Published time.Time `json:"published" url:"published,omitempty"` Read bool `json:"read" url:"read,omitempty"` RecipientID int64 `json:"recipient_id" url:"recipient_id,omitempty"` - Updated time.Time `json:"updated" url:"updated,omitempty"` } -type PrivateMessagesResponse struct { - PrivateMessages []PrivateMessageView `json:"private_messages" url:"private_messages,omitempty"` +type DeleteComment struct { + CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` + Deleted bool `json:"deleted" url:"deleted,omitempty"` +} +type GetModlog struct { + CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + ModPersonID Optional[int64] `json:"mod_person_id" url:"mod_person_id,omitempty"` + OtherPersonID Optional[int64] `json:"other_person_id" url:"other_person_id,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + Type Optional[ModlogActionType] `json:"type_" url:"type_,omitempty"` +} +type AddAdmin struct { + Added bool `json:"added" url:"added,omitempty"` + PersonID int64 `json:"person_id" url:"person_id,omitempty"` +} +type BlockCommunity struct { + Block bool `json:"block" url:"block,omitempty"` + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` +} +type PrivateMessageReportResponse struct { + PrivateMessageReportView PrivateMessageReportView `json:"private_message_report_view" url:"private_message_report_view,omitempty"` LemmyResponse } -type Search struct { +type PurgePerson struct { + PersonID int64 `json:"person_id" url:"person_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` +} +type SiteResponse struct { + SiteView SiteView `json:"site_view" url:"site_view,omitempty"` + Taglines []Tagline `json:"taglines" url:"taglines,omitempty"` + LemmyResponse +} +type CaptchaResponse struct { + PNG string `json:"png" url:"png,omitempty"` + UUID string `json:"uuid" url:"uuid,omitempty"` + WAV string `json:"wav" url:"wav,omitempty"` + LemmyResponse +} +type ModFeaturePost struct { + Featured bool `json:"featured" url:"featured,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + IsFeaturedCommunity bool `json:"is_featured_community" url:"is_featured_community,omitempty"` + ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` + PostID int64 `json:"post_id" url:"post_id,omitempty"` + When time.Time `json:"when_" url:"when_,omitempty"` +} +type FeaturePost struct { + FeatureType PostFeatureType `json:"feature_type" url:"feature_type,omitempty"` + Featured bool `json:"featured" url:"featured,omitempty"` + PostID int64 `json:"post_id" url:"post_id,omitempty"` +} +type GetRepliesResponse struct { + Replies []CommentReplyView `json:"replies" url:"replies,omitempty"` + LemmyResponse +} +type CommentReply struct { + CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Read bool `json:"read" url:"read,omitempty"` + RecipientID int64 `json:"recipient_id" url:"recipient_id,omitempty"` +} +type CommentReplyResponse struct { + CommentReplyView CommentReplyView `json:"comment_reply_view" url:"comment_reply_view,omitempty"` + LemmyResponse +} +type RegistrationApplicationView struct { + Admin Optional[Person] `json:"admin" url:"admin,omitempty"` + Creator Person `json:"creator" url:"creator,omitempty"` + CreatorLocalUser LocalUser `json:"creator_local_user" url:"creator_local_user,omitempty"` + RegistrationApplication RegistrationApplication `json:"registration_application" url:"registration_application,omitempty"` +} +type RegistrationApplication struct { + AdminID Optional[int64] `json:"admin_id" url:"admin_id,omitempty"` + Answer string `json:"answer" url:"answer,omitempty"` + DenyReason Optional[string] `json:"deny_reason" url:"deny_reason,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + LocalUserID int64 `json:"local_user_id" url:"local_user_id,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` +} +type PrivateMessageReport struct { + CreatorID int64 `json:"creator_id" url:"creator_id,omitempty"` + ID int64 `json:"id" url:"id,omitempty"` + OriginalPMText string `json:"original_pm_text" url:"original_pm_text,omitempty"` + PrivateMessageID int64 `json:"private_message_id" url:"private_message_id,omitempty"` + Published time.Time `json:"published" url:"published,omitempty"` + Reason string `json:"reason" url:"reason,omitempty"` + Resolved bool `json:"resolved" url:"resolved,omitempty"` + ResolverID Optional[int64] `json:"resolver_id" url:"resolver_id,omitempty"` + Updated time.Time `json:"updated" url:"updated,omitempty"` +} +type BanFromCommunityResponse struct { + Banned bool `json:"banned" url:"banned,omitempty"` + PersonView PersonView `json:"person_view" url:"person_view,omitempty"` + LemmyResponse +} +type GetReportCount struct { + CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` +} +type GetPrivateMessages struct { + CreatorID Optional[int64] `json:"creator_id" url:"creator_id,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` +} +type SiteMetadata struct { + Description Optional[string] `json:"description" url:"description,omitempty"` + EmbedVideoURL Optional[string] `json:"embed_video_url" url:"embed_video_url,omitempty"` + Image Optional[string] `json:"image" url:"image,omitempty"` + Title Optional[string] `json:"title" url:"title,omitempty"` +} +type ListPrivateMessageReports struct { + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + UnresolvedOnly Optional[bool] `json:"unresolved_only" url:"unresolved_only,omitempty"` +} +type CreateCommentReport struct { + CommentID int64 `json:"comment_id" url:"comment_id,omitempty"` + Reason string `json:"reason" url:"reason,omitempty"` +} +type CommunityResponse struct { + CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"` + DiscussionLanguages []int64 `json:"discussion_languages" url:"discussion_languages,omitempty"` + LemmyResponse +} +type FollowCommunity struct { + CommunityID int64 `json:"community_id" url:"community_id,omitempty"` + Follow bool `json:"follow" url:"follow,omitempty"` +} +type RegistrationApplicationResponse struct { + RegistrationApplication RegistrationApplicationView `json:"registration_application" url:"registration_application,omitempty"` + LemmyResponse +} +type GetPersonMentions struct { + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + Sort Optional[CommentSortType] `json:"sort" url:"sort,omitempty"` + UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` +} +type GetPosts struct { CommunityID Optional[int64] `json:"community_id" url:"community_id,omitempty"` CommunityName Optional[string] `json:"community_name" url:"community_name,omitempty"` - CreatorID Optional[int64] `json:"creator_id" url:"creator_id,omitempty"` + DislikedOnly Optional[bool] `json:"disliked_only" url:"disliked_only,omitempty"` + LikedOnly Optional[bool] `json:"liked_only" url:"liked_only,omitempty"` Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - ListingType Optional[ListingType] `json:"listing_type" url:"listing_type,omitempty"` Page Optional[int64] `json:"page" url:"page,omitempty"` - Q string `json:"q" url:"q,omitempty"` + PageCursor Optional[string] `json:"page_cursor" url:"page_cursor,omitempty"` + SavedOnly Optional[bool] `json:"saved_only" url:"saved_only,omitempty"` Sort Optional[SortType] `json:"sort" url:"sort,omitempty"` - Type Optional[SearchType] `json:"type_" url:"type_,omitempty"` -} -type AddAdminResponse struct { - Admins []PersonView `json:"admins" url:"admins,omitempty"` - LemmyResponse -} -type CommentSortType string - -const ( - CommentSortTypeHot CommentSortType = "Hot" - CommentSortTypeTop CommentSortType = "Top" - CommentSortTypeNew CommentSortType = "New" - CommentSortTypeOld CommentSortType = "Old" - CommentSortTypeControversial CommentSortType = "Controversial" -) - -type ModAddCommunity struct { - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - ModPersonID int64 `json:"mod_person_id" url:"mod_person_id,omitempty"` - OtherPersonID int64 `json:"other_person_id" url:"other_person_id,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` - When time.Time `json:"when_" url:"when_,omitempty"` -} -type RemoveCommunity struct { - CommunityID int64 `json:"community_id" url:"community_id,omitempty"` - Expires Optional[int64] `json:"expires" url:"expires,omitempty"` - Reason Optional[string] `json:"reason" url:"reason,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` -} -type Tagline struct { - Content string `json:"content" url:"content,omitempty"` - ID int64 `json:"id" url:"id,omitempty"` - LocalSiteID int64 `json:"local_site_id" url:"local_site_id,omitempty"` - Published time.Time `json:"published" url:"published,omitempty"` - Updated time.Time `json:"updated" url:"updated,omitempty"` -} -type GetPost struct { - CommentID Optional[int64] `json:"comment_id" url:"comment_id,omitempty"` - ID Optional[int64] `json:"id" url:"id,omitempty"` -} -type ListCommentReportsResponse struct { - CommentReports []CommentReportView `json:"comment_reports" url:"comment_reports,omitempty"` - LemmyResponse + Type Optional[ListingType] `json:"type_" url:"type_,omitempty"` } diff --git a/types/types.go b/types.go similarity index 96% rename from types/types.go rename to types.go index 3cbdd3f..7400ec7 100644 --- a/types/types.go +++ b/types.go @@ -1,4 +1,4 @@ -package types +package lemmy // EmptyResponse is a response without any fields. // It embeds LemmyResponse to capture any errors.