From 0b8023a108ff929097a4f5010f64b2dbd263d435 Mon Sep 17 00:00:00 2001 From: Elara Musayelyan Date: Mon, 30 Jan 2023 19:38:57 -0800 Subject: [PATCH] Update for 0.17.0 --- cmd/gen/generator/routes.go | 8 +- cmd/gen/main.go | 2 +- routes.gen.go | 126 ++++++++++++----- types/activity.gen.go | 10 +- types/actor_language.gen.go | 32 +++++ types/comment.1.gen.go | 71 +++++----- types/comment.gen.go | 45 +++--- types/comment_reply.gen.go | 20 +++ types/community.1.gen.go | 44 ++++-- types/community.gen.go | 15 +- types/federation_allowlist.gen.go | 15 ++ types/federation_blocklist.gen.go | 15 ++ types/handlers.gen.go | 4 + types/instance.gen.go | 15 ++ types/language.gen.go | 10 ++ types/lib.1.gen.go | 47 ++++++- types/lib.2.gen.go | 93 ------------ types/local_site.gen.go | 84 +++++++++++ types/local_site_rate_limit.gen.go | 53 +++++++ types/local_user.gen.go | 57 +++++--- types/mod.1.gen.go | 4 + types/mod.gen.go | 101 +++++++++++++- types/moderator.gen.go | 66 +++++++-- types/person.1.gen.go | 103 ++++---------- types/person.gen.go | 75 ++++------ types/person_mention.gen.go | 5 +- types/post.1.gen.go | 100 ++++++++----- types/post.gen.go | 37 ++--- types/private_message.1.gen.go | 37 +++++ types/private_message.gen.go | 79 ++++++++--- types/private_message_report.gen.go | 22 +++ types/registration_application.gen.go | 12 +- types/send.gen.go | 4 + types/site.1.gen.go | 87 ++++++------ types/site.gen.go | 194 ++++++++++++++++++-------- types/structs.1.gen.go | 115 +++++++-------- types/structs.2.gen.go | 128 +++++++++-------- types/structs.3.gen.go | 134 +++++++++++------- types/structs.4.gen.go | 72 ++++++++++ types/structs.gen.go | 63 ++++----- types/tagline.gen.go | 17 +++ types/types.go | 4 + types/utils.gen.go | 10 ++ types/websocket.gen.go | 33 ----- 44 files changed, 1477 insertions(+), 791 deletions(-) create mode 100644 types/actor_language.gen.go create mode 100644 types/comment_reply.gen.go create mode 100644 types/federation_allowlist.gen.go create mode 100644 types/federation_blocklist.gen.go create mode 100644 types/handlers.gen.go create mode 100644 types/instance.gen.go create mode 100644 types/language.gen.go delete mode 100644 types/lib.2.gen.go create mode 100644 types/local_site.gen.go create mode 100644 types/local_site_rate_limit.gen.go create mode 100644 types/mod.1.gen.go create mode 100644 types/private_message.1.gen.go create mode 100644 types/private_message_report.gen.go create mode 100644 types/send.gen.go create mode 100644 types/structs.4.gen.go create mode 100644 types/tagline.gen.go delete mode 100644 types/websocket.gen.go diff --git a/cmd/gen/generator/routes.go b/cmd/gen/generator/routes.go index efe1914..9aaec6b 100644 --- a/cmd/gen/generator/routes.go +++ b/cmd/gen/generator/routes.go @@ -26,7 +26,7 @@ func (r *RoutesGenerator) Generate(routes []parser.Route, impls map[string]strin f.Func().Params( jen.Id("c").Id("*Client"), - ).Id(strings.TrimPrefix(r.Struct, "Get")).Params( + ).Id(transformName(r.Struct)).Params( jen.Id("ctx").Qual("context", "Context"), jen.Id("data").Qual("go.arsenm.dev/go-lemmy/types", r.Struct), ).Params( @@ -61,3 +61,9 @@ func (r *RoutesGenerator) Generate(routes []parser.Route, impls map[string]strin return f.Render(r.w) } + +func transformName(s string) string { + s = strings.TrimPrefix(s, "Get") + s = strings.TrimPrefix(s, "List") + return s +} diff --git a/cmd/gen/main.go b/cmd/gen/main.go index b9de703..9539fd2 100644 --- a/cmd/gen/main.go +++ b/cmd/gen/main.go @@ -35,7 +35,7 @@ var structDirs = [...]string{ "crates/websocket/src/lib.rs", } -const routesFile = "src/api_routes.rs" +const routesFile = "src/api_routes_http.rs" func main() { lemmyDir := flag.String("lemmy-dir", "lemmy", "Path to Lemmy repository") diff --git a/routes.gen.go b/routes.gen.go index 5aae8ef..db4bf23 100644 --- a/routes.gen.go +++ b/routes.gen.go @@ -1,4 +1,4 @@ -// Source: lemmy/src/api_routes.rs +// Source: lemmy/src/api_routes_http.rs // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (routes generator). DO NOT EDIT. package lemmy @@ -44,30 +44,6 @@ func (c *Client) EditSite(ctx context.Context, data types.EditSite) (*types.Site } return resData, nil } -func (c *Client) SiteConfig(ctx context.Context, data types.GetSiteConfig) (*types.GetSiteConfigResponse, error) { - resData := &types.GetSiteConfigResponse{} - res, err := c.getReq(ctx, "GET", "/site/config", data, &resData) - if err != nil { - return nil, err - } - err = resError(res, resData.LemmyResponse) - if err != nil { - return nil, err - } - return resData, nil -} -func (c *Client) SaveSiteConfig(ctx context.Context, data types.SaveSiteConfig) (*types.GetSiteConfigResponse, error) { - resData := &types.GetSiteConfigResponse{} - res, err := c.req(ctx, "PUT", "/site/config", data, &resData) - if err != nil { - return nil, err - } - err = resError(res, resData.LemmyResponse) - if err != nil { - return nil, err - } - return resData, nil -} func (c *Client) Modlog(ctx context.Context, data types.GetModlog) (*types.GetModlogResponse, error) { resData := &types.GetModlogResponse{} res, err := c.getReq(ctx, "GET", "/modlog", data, &resData) @@ -152,7 +128,7 @@ func (c *Client) HideCommunity(ctx context.Context, data types.HideCommunity) (* } return resData, nil } -func (c *Client) ListCommunities(ctx context.Context, data types.ListCommunities) (*types.ListCommunitiesResponse, error) { +func (c *Client) Communities(ctx context.Context, data types.ListCommunities) (*types.ListCommunitiesResponse, error) { resData := &types.ListCommunitiesResponse{} res, err := c.getReq(ctx, "GET", "/community/list", data, &resData) if err != nil { @@ -356,9 +332,9 @@ func (c *Client) LockPost(ctx context.Context, data types.LockPost) (*types.Post } return resData, nil } -func (c *Client) StickyPost(ctx context.Context, data types.StickyPost) (*types.PostResponse, error) { +func (c *Client) FeaturePost(ctx context.Context, data types.FeaturePost) (*types.PostResponse, error) { resData := &types.PostResponse{} - res, err := c.req(ctx, "POST", "/post/sticky", data, &resData) + res, err := c.req(ctx, "POST", "/post/feature", data, &resData) if err != nil { return nil, err } @@ -440,7 +416,7 @@ func (c *Client) ResolvePostReport(ctx context.Context, data types.ResolvePostRe } return resData, nil } -func (c *Client) ListPostReports(ctx context.Context, data types.ListPostReports) (*types.ListPostReportsResponse, error) { +func (c *Client) PostReports(ctx context.Context, data types.ListPostReports) (*types.ListPostReportsResponse, error) { resData := &types.ListPostReportsResponse{} res, err := c.getReq(ctx, "GET", "/post/report/list", data, &resData) if err != nil { @@ -524,8 +500,8 @@ func (c *Client) RemoveComment(ctx context.Context, data types.RemoveComment) (* } return resData, nil } -func (c *Client) MarkCommentAsRead(ctx context.Context, data types.MarkCommentAsRead) (*types.CommentResponse, error) { - resData := &types.CommentResponse{} +func (c *Client) MarkCommentReplyAsRead(ctx context.Context, data types.MarkCommentReplyAsRead) (*types.CommentReplyResponse, error) { + resData := &types.CommentReplyResponse{} res, err := c.req(ctx, "POST", "/comment/mark_as_read", data, &resData) if err != nil { return nil, err @@ -596,7 +572,7 @@ func (c *Client) ResolveCommentReport(ctx context.Context, data types.ResolveCom } return resData, nil } -func (c *Client) ListCommentReports(ctx context.Context, data types.ListCommentReports) (*types.ListCommentReportsResponse, error) { +func (c *Client) CommentReports(ctx context.Context, data types.ListCommentReports) (*types.ListCommentReportsResponse, error) { resData := &types.ListCommentReportsResponse{} res, err := c.getReq(ctx, "GET", "/comment/report/list", data, &resData) if err != nil { @@ -668,6 +644,42 @@ func (c *Client) MarkPrivateMessageAsRead(ctx context.Context, data types.MarkPr } return resData, nil } +func (c *Client) CreatePrivateMessageReport(ctx context.Context, data types.CreatePrivateMessageReport) (*types.PrivateMessageReportResponse, error) { + resData := &types.PrivateMessageReportResponse{} + res, err := c.req(ctx, "POST", "/private_message/report", data, &resData) + if err != nil { + return nil, err + } + err = resError(res, resData.LemmyResponse) + if err != nil { + return nil, err + } + return resData, nil +} +func (c *Client) ResolvePrivateMessageReport(ctx context.Context, data types.ResolvePrivateMessageReport) (*types.PrivateMessageReportResponse, error) { + resData := &types.PrivateMessageReportResponse{} + res, err := c.req(ctx, "PUT", "/private_message/report/resolve", data, &resData) + if err != nil { + return nil, err + } + err = resError(res, resData.LemmyResponse) + if err != nil { + return nil, err + } + return resData, nil +} +func (c *Client) PrivateMessageReports(ctx context.Context, data types.ListPrivateMessageReports) (*types.ListPrivateMessageReportsResponse, error) { + resData := &types.ListPrivateMessageReportsResponse{} + res, err := c.getReq(ctx, "GET", "/private_message/report/list", data, &resData) + if err != nil { + return nil, err + } + err = resError(res, resData.LemmyResponse) + if err != nil { + return nil, err + } + return resData, nil +} func (c *Client) Register(ctx context.Context, data types.Register) (*types.LoginResponse, error) { resData := &types.LoginResponse{} res, err := c.req(ctx, "POST", "/user/register", data, &resData) @@ -944,7 +956,7 @@ func (c *Client) UnreadRegistrationApplicationCount(ctx context.Context, data ty } return resData, nil } -func (c *Client) ListRegistrationApplications(ctx context.Context, data types.ListRegistrationApplications) (*types.ListRegistrationApplicationsResponse, error) { +func (c *Client) RegistrationApplications(ctx context.Context, data types.ListRegistrationApplications) (*types.ListRegistrationApplicationsResponse, error) { resData := &types.ListRegistrationApplicationsResponse{} res, err := c.getReq(ctx, "GET", "/admin/registration_application/list", data, &resData) if err != nil { @@ -968,3 +980,51 @@ func (c *Client) ApproveRegistrationApplication(ctx context.Context, data types. } return resData, nil } +func (c *Client) PurgePerson(ctx context.Context, data types.PurgePerson) (*types.PurgeItemResponse, error) { + resData := &types.PurgeItemResponse{} + res, err := c.req(ctx, "POST", "/admin/purge/person", data, &resData) + if err != nil { + return nil, err + } + err = resError(res, resData.LemmyResponse) + if err != nil { + return nil, err + } + return resData, nil +} +func (c *Client) PurgeCommunity(ctx context.Context, data types.PurgeCommunity) (*types.PurgeItemResponse, error) { + resData := &types.PurgeItemResponse{} + res, err := c.req(ctx, "POST", "/admin/purge/community", data, &resData) + if err != nil { + return nil, err + } + err = resError(res, resData.LemmyResponse) + if err != nil { + return nil, err + } + return resData, nil +} +func (c *Client) PurgePost(ctx context.Context, data types.PurgePost) (*types.PurgeItemResponse, error) { + resData := &types.PurgeItemResponse{} + res, err := c.req(ctx, "POST", "/admin/purge/post", data, &resData) + if err != nil { + return nil, err + } + err = resError(res, resData.LemmyResponse) + if err != nil { + return nil, err + } + return resData, nil +} +func (c *Client) PurgeComment(ctx context.Context, data types.PurgeComment) (*types.PurgeItemResponse, error) { + resData := &types.PurgeItemResponse{} + res, err := c.req(ctx, "POST", "/admin/purge/comment", data, &resData) + if err != nil { + return nil, err + } + err = resError(res, resData.LemmyResponse) + if err != nil { + return nil, err + } + return resData, nil +} diff --git a/types/activity.gen.go b/types/activity.gen.go index fe5a211..7e656d7 100644 --- a/types/activity.gen.go +++ b/types/activity.gen.go @@ -12,10 +12,16 @@ type Activity struct { ApID string `json:"ap_id" url:"ap_id,omitempty"` Sensitive Optional[bool] `json:"sensitive" url:"sensitive,omitempty"` } -type ActivityForm struct { +type ActivityInsertForm struct { Data any `json:"data" url:"data,omitempty"` Local Optional[bool] `json:"local" url:"local,omitempty"` Updated LemmyTime `json:"updated" url:"updated,omitempty"` ApID string `json:"ap_id" url:"ap_id,omitempty"` - Sensitive bool `json:"sensitive" url:"sensitive,omitempty"` + Sensitive Optional[bool] `json:"sensitive" url:"sensitive,omitempty"` +} +type ActivityUpdateForm struct { + Data any `json:"data" url:"data,omitempty"` + Local Optional[bool] `json:"local" url:"local,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + Sensitive Optional[Optional[bool]] `json:"sensitive" url:"sensitive,omitempty"` } diff --git a/types/actor_language.gen.go b/types/actor_language.gen.go new file mode 100644 index 0000000..1b2ec89 --- /dev/null +++ b/types/actor_language.gen.go @@ -0,0 +1,32 @@ +// Source: lemmy/crates/db_schema/src/source/actor_language.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types + +type LocalUserLanguage struct { + ID int `json:"id" url:"id,omitempty"` + LocalUserID int `json:"local_user_id" url:"local_user_id,omitempty"` + LanguageID int `json:"language_id" url:"language_id,omitempty"` +} +type LocalUserLanguageForm struct { + LocalUserID int `json:"local_user_id" url:"local_user_id,omitempty"` + LanguageID int `json:"language_id" url:"language_id,omitempty"` +} +type CommunityLanguage struct { + ID int `json:"id" url:"id,omitempty"` + CommunityID int `json:"community_id" url:"community_id,omitempty"` + LanguageID int `json:"language_id" url:"language_id,omitempty"` +} +type CommunityLanguageForm struct { + CommunityID int `json:"community_id" url:"community_id,omitempty"` + LanguageID int `json:"language_id" url:"language_id,omitempty"` +} +type SiteLanguage struct { + ID int `json:"id" url:"id,omitempty"` + SiteID int `json:"site_id" url:"site_id,omitempty"` + LanguageID int `json:"language_id" url:"language_id,omitempty"` +} +type SiteLanguageForm struct { + SiteID int `json:"site_id" url:"site_id,omitempty"` + LanguageID int `json:"language_id" url:"language_id,omitempty"` +} diff --git a/types/comment.1.gen.go b/types/comment.1.gen.go index 329dd03..4428afa 100644 --- a/types/comment.1.gen.go +++ b/types/comment.1.gen.go @@ -4,45 +4,42 @@ package types type Comment struct { - ID int `json:"id" url:"id,omitempty"` - CreatorID int `json:"creator_id" url:"creator_id,omitempty"` - PostID int `json:"post_id" url:"post_id,omitempty"` - ParentID Optional[int] `json:"parent_id" url:"parent_id,omitempty"` - Content string `json:"content" url:"content,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` - Read bool `json:"read" url:"read,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - Updated LemmyTime `json:"updated" url:"updated,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` - ApID string `json:"ap_id" url:"ap_id,omitempty"` - Local bool `json:"local" url:"local,omitempty"` + ID int `json:"id" url:"id,omitempty"` + CreatorID int `json:"creator_id" url:"creator_id,omitempty"` + PostID int `json:"post_id" url:"post_id,omitempty"` + Content string `json:"content" url:"content,omitempty"` + Removed bool `json:"removed" url:"removed,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + Deleted bool `json:"deleted" url:"deleted,omitempty"` + ApID string `json:"ap_id" url:"ap_id,omitempty"` + Local bool `json:"local" url:"local,omitempty"` + Path string `json:"path" url:"path,omitempty"` + Distinguished bool `json:"distinguished" url:"distinguished,omitempty"` + LanguageID int `json:"language_id" url:"language_id,omitempty"` } -type CommentAlias1 struct { - ID int `json:"id" url:"id,omitempty"` - CreatorID int `json:"creator_id" url:"creator_id,omitempty"` - PostID int `json:"post_id" url:"post_id,omitempty"` - ParentID Optional[int] `json:"parent_id" url:"parent_id,omitempty"` - Content string `json:"content" url:"content,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` - Read bool `json:"read" url:"read,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - Updated LemmyTime `json:"updated" url:"updated,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` - ApID string `json:"ap_id" url:"ap_id,omitempty"` - Local bool `json:"local" url:"local,omitempty"` +type CommentInsertForm struct { + CreatorID int `json:"creator_id" url:"creator_id,omitempty"` + PostID int `json:"post_id" url:"post_id,omitempty"` + Content string `json:"content" url:"content,omitempty"` + Removed Optional[bool] `json:"removed" url:"removed,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + Deleted Optional[bool] `json:"deleted" url:"deleted,omitempty"` + ApID Optional[string] `json:"ap_id" url:"ap_id,omitempty"` + Local Optional[bool] `json:"local" url:"local,omitempty"` + Distinguished Optional[bool] `json:"distinguished" url:"distinguished,omitempty"` + LanguageID Optional[int] `json:"language_id" url:"language_id,omitempty"` } -type CommentForm struct { - CreatorID int `json:"creator_id" url:"creator_id,omitempty"` - PostID int `json:"post_id" url:"post_id,omitempty"` - Content string `json:"content" url:"content,omitempty"` - ParentID Optional[int] `json:"parent_id" url:"parent_id,omitempty"` - Removed Optional[bool] `json:"removed" url:"removed,omitempty"` - Read Optional[bool] `json:"read" url:"read,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - Updated LemmyTime `json:"updated" url:"updated,omitempty"` - Deleted Optional[bool] `json:"deleted" url:"deleted,omitempty"` - ApID Optional[string] `json:"ap_id" url:"ap_id,omitempty"` - Local Optional[bool] `json:"local" url:"local,omitempty"` +type CommentUpdateForm struct { + Content Optional[string] `json:"content" url:"content,omitempty"` + Removed Optional[bool] `json:"removed" url:"removed,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + Deleted Optional[bool] `json:"deleted" url:"deleted,omitempty"` + ApID Optional[string] `json:"ap_id" url:"ap_id,omitempty"` + Local Optional[bool] `json:"local" url:"local,omitempty"` + Distinguished Optional[bool] `json:"distinguished" url:"distinguished,omitempty"` + LanguageID Optional[int] `json:"language_id" url:"language_id,omitempty"` } type CommentLike struct { ID int32 `json:"id" url:"id,omitempty"` diff --git a/types/comment.gen.go b/types/comment.gen.go index 69e1c4a..86c3f28 100644 --- a/types/comment.gen.go +++ b/types/comment.gen.go @@ -4,21 +4,24 @@ package types type CreateComment struct { - Content string `json:"content" url:"content,omitempty"` - PostID int `json:"post_id" url:"post_id,omitempty"` - ParentID Optional[int] `json:"parent_id" url:"parent_id,omitempty"` - FormID Optional[string] `json:"form_id" url:"form_id,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` + Content string `json:"content" url:"content,omitempty"` + PostID int `json:"post_id" url:"post_id,omitempty"` + ParentID Optional[int] `json:"parent_id" url:"parent_id,omitempty"` + LanguageID Optional[int] `json:"language_id" url:"language_id,omitempty"` + FormID Optional[string] `json:"form_id" url:"form_id,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` } type GetComment struct { ID int `json:"id" url:"id,omitempty"` Auth Optional[string] `json:"auth" url:"auth,omitempty"` } type EditComment struct { - Content string `json:"content" url:"content,omitempty"` - CommentID int `json:"comment_id" url:"comment_id,omitempty"` - FormID Optional[string] `json:"form_id" url:"form_id,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` + CommentID int `json:"comment_id" url:"comment_id,omitempty"` + Content Optional[string] `json:"content" url:"content,omitempty"` + Distinguished Optional[bool] `json:"distinguished" url:"distinguished,omitempty"` + LanguageID Optional[int] `json:"language_id" url:"language_id,omitempty"` + FormID Optional[string] `json:"form_id" url:"form_id,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` } type DeleteComment struct { CommentID int `json:"comment_id" url:"comment_id,omitempty"` @@ -31,11 +34,6 @@ type RemoveComment struct { Reason Optional[string] `json:"reason" url:"reason,omitempty"` Auth string `json:"auth" url:"auth,omitempty"` } -type MarkCommentAsRead struct { - CommentID int `json:"comment_id" url:"comment_id,omitempty"` - Read bool `json:"read" url:"read,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` -} type SaveComment struct { CommentID int `json:"comment_id" url:"comment_id,omitempty"` Save bool `json:"save" url:"save,omitempty"` @@ -53,14 +51,17 @@ type CreateCommentLike struct { Auth string `json:"auth" url:"auth,omitempty"` } type GetComments struct { - Type Optional[ListingType] `json:"type_" url:"type_,omitempty"` - Sort Optional[SortType] `json:"sort" url:"sort,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - CommunityID Optional[int] `json:"community_id" url:"community_id,omitempty"` - CommunityName Optional[string] `json:"community_name" url:"community_name,omitempty"` - SavedOnly Optional[bool] `json:"saved_only" url:"saved_only,omitempty"` - Auth Optional[string] `json:"auth" url:"auth,omitempty"` + Type Optional[ListingType] `json:"type_" url:"type_,omitempty"` + Sort Optional[CommentSortType] `json:"sort" url:"sort,omitempty"` + MaxDepth Optional[int32] `json:"max_depth" url:"max_depth,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + CommunityID Optional[int] `json:"community_id" url:"community_id,omitempty"` + CommunityName Optional[string] `json:"community_name" url:"community_name,omitempty"` + PostID Optional[int] `json:"post_id" url:"post_id,omitempty"` + ParentID Optional[int] `json:"parent_id" url:"parent_id,omitempty"` + SavedOnly Optional[bool] `json:"saved_only" url:"saved_only,omitempty"` + Auth Optional[string] `json:"auth" url:"auth,omitempty"` } type GetCommentsResponse struct { Comments []CommentView `json:"comments" url:"comments,omitempty"` diff --git a/types/comment_reply.gen.go b/types/comment_reply.gen.go new file mode 100644 index 0000000..0d02d54 --- /dev/null +++ b/types/comment_reply.gen.go @@ -0,0 +1,20 @@ +// Source: lemmy/crates/db_schema/src/source/comment_reply.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types + +type CommentReply struct { + ID int `json:"id" url:"id,omitempty"` + RecipientID int `json:"recipient_id" url:"recipient_id,omitempty"` + CommentID int `json:"comment_id" url:"comment_id,omitempty"` + Read bool `json:"read" url:"read,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` +} +type CommentReplyInsertForm struct { + RecipientID int `json:"recipient_id" url:"recipient_id,omitempty"` + CommentID int `json:"comment_id" url:"comment_id,omitempty"` + Read Optional[bool] `json:"read" url:"read,omitempty"` +} +type CommentReplyUpdateForm struct { + Read Optional[bool] `json:"read" url:"read,omitempty"` +} diff --git a/types/community.1.gen.go b/types/community.1.gen.go index 4b4b761..91f0146 100644 --- a/types/community.1.gen.go +++ b/types/community.1.gen.go @@ -25,6 +25,7 @@ type Community struct { SharedInboxURL Optional[string] `json:"shared_inbox_url" url:"shared_inbox_url,omitempty"` Hidden bool `json:"hidden" url:"hidden,omitempty"` PostingRestrictedToMods bool `json:"posting_restricted_to_mods" url:"posting_restricted_to_mods,omitempty"` + InstanceID int `json:"instance_id" url:"instance_id,omitempty"` } type CommunitySafe struct { ID int `json:"id" url:"id,omitempty"` @@ -42,11 +43,34 @@ type CommunitySafe struct { Banner Optional[string] `json:"banner" url:"banner,omitempty"` Hidden bool `json:"hidden" url:"hidden,omitempty"` PostingRestrictedToMods bool `json:"posting_restricted_to_mods" url:"posting_restricted_to_mods,omitempty"` + InstanceID int `json:"instance_id" url:"instance_id,omitempty"` } -type CommunityForm struct { - Name string `json:"name" url:"name,omitempty"` - Title string `json:"title" url:"title,omitempty"` - Description Optional[string] `json:"description" url:"description,omitempty"` +type CommunityInsertForm struct { + Name string `json:"name" url:"name,omitempty"` + Title string `json:"title" url:"title,omitempty"` + Description Optional[string] `json:"description" url:"description,omitempty"` + Removed Optional[bool] `json:"removed" url:"removed,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + Deleted Optional[bool] `json:"deleted" url:"deleted,omitempty"` + NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` + ActorID Optional[string] `json:"actor_id" url:"actor_id,omitempty"` + Local Optional[bool] `json:"local" url:"local,omitempty"` + PrivateKey Optional[string] `json:"private_key" url:"private_key,omitempty"` + PublicKey string `json:"public_key" url:"public_key,omitempty"` + LastRefreshedAt LemmyTime `json:"last_refreshed_at" url:"last_refreshed_at,omitempty"` + Icon Optional[string] `json:"icon" url:"icon,omitempty"` + Banner Optional[string] `json:"banner" url:"banner,omitempty"` + FollowersURL Optional[string] `json:"followers_url" url:"followers_url,omitempty"` + InboxURL Optional[string] `json:"inbox_url" url:"inbox_url,omitempty"` + SharedInboxURL Optional[string] `json:"shared_inbox_url" url:"shared_inbox_url,omitempty"` + Hidden Optional[bool] `json:"hidden" url:"hidden,omitempty"` + PostingRestrictedToMods Optional[bool] `json:"posting_restricted_to_mods" url:"posting_restricted_to_mods,omitempty"` + InstanceID int `json:"instance_id" url:"instance_id,omitempty"` +} +type CommunityUpdateForm struct { + Title Optional[string] `json:"title" url:"title,omitempty"` + Description Optional[Optional[string]] `json:"description" url:"description,omitempty"` Removed Optional[bool] `json:"removed" url:"removed,omitempty"` Published LemmyTime `json:"published" url:"published,omitempty"` Updated LemmyTime `json:"updated" url:"updated,omitempty"` @@ -54,8 +78,8 @@ type CommunityForm struct { NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` ActorID Optional[string] `json:"actor_id" url:"actor_id,omitempty"` Local Optional[bool] `json:"local" url:"local,omitempty"` - PrivateKey Optional[Optional[string]] `json:"private_key" url:"private_key,omitempty"` PublicKey Optional[string] `json:"public_key" url:"public_key,omitempty"` + PrivateKey Optional[Optional[string]] `json:"private_key" url:"private_key,omitempty"` LastRefreshedAt LemmyTime `json:"last_refreshed_at" url:"last_refreshed_at,omitempty"` Icon Optional[Optional[string]] `json:"icon" url:"icon,omitempty"` Banner Optional[Optional[string]] `json:"banner" url:"banner,omitempty"` @@ -88,11 +112,11 @@ type CommunityPersonBanForm struct { Expires LemmyTime `json:"expires" url:"expires,omitempty"` } type CommunityFollower struct { - ID int32 `json:"id" url:"id,omitempty"` - CommunityID int `json:"community_id" url:"community_id,omitempty"` - PersonID int `json:"person_id" url:"person_id,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - Pending Optional[bool] `json:"pending" url:"pending,omitempty"` + ID int32 `json:"id" url:"id,omitempty"` + CommunityID int `json:"community_id" url:"community_id,omitempty"` + PersonID int `json:"person_id" url:"person_id,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Pending bool `json:"pending" url:"pending,omitempty"` } type CommunityFollowerForm struct { CommunityID int `json:"community_id" url:"community_id,omitempty"` diff --git a/types/community.gen.go b/types/community.gen.go index b124fb5..1f8e9e7 100644 --- a/types/community.gen.go +++ b/types/community.gen.go @@ -9,10 +9,12 @@ type GetCommunity struct { Auth Optional[string] `json:"auth" url:"auth,omitempty"` } type GetCommunityResponse struct { - CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"` - Site Optional[Site] `json:"site" url:"site,omitempty"` - Moderators []CommunityModeratorView `json:"moderators" url:"moderators,omitempty"` - Online uint `json:"online" url:"online,omitempty"` + CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"` + Site Optional[Site] `json:"site" url:"site,omitempty"` + Moderators []CommunityModeratorView `json:"moderators" url:"moderators,omitempty"` + Online uint `json:"online" url:"online,omitempty"` + DiscussionLanguages []int `json:"discussion_languages" url:"discussion_languages,omitempty"` + DefaultPostLanguage Optional[int] `json:"default_post_language" url:"default_post_language,omitempty"` LemmyResponse } type CreateCommunity struct { @@ -23,10 +25,12 @@ type CreateCommunity struct { Banner Optional[string] `json:"banner" url:"banner,omitempty"` NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` PostingRestrictedToMods Optional[bool] `json:"posting_restricted_to_mods" url:"posting_restricted_to_mods,omitempty"` + DiscussionLanguages Optional[[]int] `json:"discussion_languages" url:"discussion_languages,omitempty"` Auth string `json:"auth" url:"auth,omitempty"` } type CommunityResponse struct { - CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"` + CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"` + DiscussionLanguages []int `json:"discussion_languages" url:"discussion_languages,omitempty"` LemmyResponse } type ListCommunities struct { @@ -72,6 +76,7 @@ type EditCommunity struct { Banner Optional[string] `json:"banner" url:"banner,omitempty"` NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` PostingRestrictedToMods Optional[bool] `json:"posting_restricted_to_mods" url:"posting_restricted_to_mods,omitempty"` + DiscussionLanguages Optional[[]int] `json:"discussion_languages" url:"discussion_languages,omitempty"` Auth string `json:"auth" url:"auth,omitempty"` } type HideCommunity struct { diff --git a/types/federation_allowlist.gen.go b/types/federation_allowlist.gen.go new file mode 100644 index 0000000..0cb65d5 --- /dev/null +++ b/types/federation_allowlist.gen.go @@ -0,0 +1,15 @@ +// Source: lemmy/crates/db_schema/src/source/federation_allowlist.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types + +type FederationAllowList struct { + ID int32 `json:"id" url:"id,omitempty"` + InstanceID int `json:"instance_id" url:"instance_id,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` +} +type FederationAllowListForm struct { + InstanceID int `json:"instance_id" url:"instance_id,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` +} diff --git a/types/federation_blocklist.gen.go b/types/federation_blocklist.gen.go new file mode 100644 index 0000000..f8b38c8 --- /dev/null +++ b/types/federation_blocklist.gen.go @@ -0,0 +1,15 @@ +// Source: lemmy/crates/db_schema/src/source/federation_blocklist.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types + +type FederationBlockList struct { + ID int32 `json:"id" url:"id,omitempty"` + InstanceID int `json:"instance_id" url:"instance_id,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` +} +type FederationBlockListForm struct { + InstanceID int `json:"instance_id" url:"instance_id,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` +} diff --git a/types/handlers.gen.go b/types/handlers.gen.go new file mode 100644 index 0000000..bfc9dbc --- /dev/null +++ b/types/handlers.gen.go @@ -0,0 +1,4 @@ +// Source: lemmy/crates/api_common/src/websocket/handlers.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types diff --git a/types/instance.gen.go b/types/instance.gen.go new file mode 100644 index 0000000..287efb7 --- /dev/null +++ b/types/instance.gen.go @@ -0,0 +1,15 @@ +// Source: lemmy/crates/db_schema/src/source/instance.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types + +type Instance struct { + ID int `json:"id" url:"id,omitempty"` + Domain string `json:"domain" url:"domain,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` +} +type InstanceForm struct { + Domain string `json:"domain" url:"domain,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` +} diff --git a/types/language.gen.go b/types/language.gen.go new file mode 100644 index 0000000..2e538c2 --- /dev/null +++ b/types/language.gen.go @@ -0,0 +1,10 @@ +// Source: lemmy/crates/db_schema/src/source/language.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types + +type Language struct { + ID int `json:"id" url:"id,omitempty"` + Code string `json:"code" url:"code,omitempty"` + Name string `json:"name" url:"name,omitempty"` +} diff --git a/types/lib.1.gen.go b/types/lib.1.gen.go index 668349c..4af609e 100644 --- a/types/lib.1.gen.go +++ b/types/lib.1.gen.go @@ -9,6 +9,7 @@ const ( SortTypeActive SortType = "Active" SortTypeHot SortType = "Hot" SortTypeNew SortType = "New" + SortTypeOld SortType = "Old" SortTypeTopDay SortType = "TopDay" SortTypeTopWeek SortType = "TopWeek" SortTypeTopMonth SortType = "TopMonth" @@ -18,13 +19,21 @@ const ( SortTypeNewComments SortType = "NewComments" ) +type CommentSortType string + +const ( + CommentSortTypeHot CommentSortType = "Hot" + CommentSortTypeTop CommentSortType = "Top" + CommentSortTypeNew CommentSortType = "New" + CommentSortTypeOld CommentSortType = "Old" +) + type ListingType string const ( ListingTypeAll ListingType = "All" ListingTypeLocal ListingType = "Local" ListingTypeSubscribed ListingType = "Subscribed" - ListingTypeCommunity ListingType = "Community" ) type SearchType string @@ -37,3 +46,39 @@ const ( SearchTypeUsers SearchType = "Users" SearchTypeUrl SearchType = "Url" ) + +type SubscribedType string + +const ( + SubscribedTypeSubscribed SubscribedType = "Subscribed" + SubscribedTypeNotSubscribed SubscribedType = "NotSubscribed" + SubscribedTypePending SubscribedType = "Pending" +) + +type ModlogActionType string + +const ( + ModlogActionTypeAll ModlogActionType = "All" + ModlogActionTypeModRemovePost ModlogActionType = "ModRemovePost" + ModlogActionTypeModLockPost ModlogActionType = "ModLockPost" + ModlogActionTypeModFeaturePost ModlogActionType = "ModFeaturePost" + ModlogActionTypeModRemoveComment ModlogActionType = "ModRemoveComment" + ModlogActionTypeModRemoveCommunity ModlogActionType = "ModRemoveCommunity" + ModlogActionTypeModBanFromCommunity ModlogActionType = "ModBanFromCommunity" + ModlogActionTypeModAddCommunity ModlogActionType = "ModAddCommunity" + ModlogActionTypeModTransferCommunity ModlogActionType = "ModTransferCommunity" + ModlogActionTypeModAdd ModlogActionType = "ModAdd" + ModlogActionTypeModBan ModlogActionType = "ModBan" + ModlogActionTypeModHideCommunity ModlogActionType = "ModHideCommunity" + ModlogActionTypeAdminPurgePerson ModlogActionType = "AdminPurgePerson" + ModlogActionTypeAdminPurgeCommunity ModlogActionType = "AdminPurgeCommunity" + ModlogActionTypeAdminPurgePost ModlogActionType = "AdminPurgePost" + ModlogActionTypeAdminPurgeComment ModlogActionType = "AdminPurgeComment" +) + +type PostFeatureType string + +const ( + PostFeatureTypeLocal PostFeatureType = "Local" + PostFeatureTypeCommunity PostFeatureType = "Community" +) diff --git a/types/lib.2.gen.go b/types/lib.2.gen.go deleted file mode 100644 index 5622f28..0000000 --- a/types/lib.2.gen.go +++ /dev/null @@ -1,93 +0,0 @@ -// Source: lemmy/crates/websocket/src/lib.rs -// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. - -package types - -type UserOperation string - -const ( - UserOperationLogin UserOperation = "Login" - UserOperationGetCaptcha UserOperation = "GetCaptcha" - UserOperationMarkCommentAsRead UserOperation = "MarkCommentAsRead" - UserOperationSaveComment UserOperation = "SaveComment" - UserOperationCreateCommentLike UserOperation = "CreateCommentLike" - UserOperationCreateCommentReport UserOperation = "CreateCommentReport" - UserOperationResolveCommentReport UserOperation = "ResolveCommentReport" - UserOperationListCommentReports UserOperation = "ListCommentReports" - UserOperationCreatePostLike UserOperation = "CreatePostLike" - UserOperationLockPost UserOperation = "LockPost" - UserOperationStickyPost UserOperation = "StickyPost" - UserOperationMarkPostAsRead UserOperation = "MarkPostAsRead" - UserOperationSavePost UserOperation = "SavePost" - UserOperationCreatePostReport UserOperation = "CreatePostReport" - UserOperationResolvePostReport UserOperation = "ResolvePostReport" - UserOperationListPostReports UserOperation = "ListPostReports" - UserOperationGetReportCount UserOperation = "GetReportCount" - UserOperationGetUnreadCount UserOperation = "GetUnreadCount" - UserOperationVerifyEmail UserOperation = "VerifyEmail" - UserOperationFollowCommunity UserOperation = "FollowCommunity" - UserOperationGetReplies UserOperation = "GetReplies" - UserOperationGetPersonMentions UserOperation = "GetPersonMentions" - UserOperationMarkPersonMentionAsRead UserOperation = "MarkPersonMentionAsRead" - UserOperationGetModlog UserOperation = "GetModlog" - UserOperationBanFromCommunity UserOperation = "BanFromCommunity" - UserOperationAddModToCommunity UserOperation = "AddModToCommunity" - UserOperationAddAdmin UserOperation = "AddAdmin" - UserOperationGetUnreadRegistrationApplicationCount UserOperation = "GetUnreadRegistrationApplicationCount" - UserOperationListRegistrationApplications UserOperation = "ListRegistrationApplications" - UserOperationApproveRegistrationApplication UserOperation = "ApproveRegistrationApplication" - UserOperationBanPerson UserOperation = "BanPerson" - UserOperationGetBannedPersons UserOperation = "GetBannedPersons" - UserOperationSearch UserOperation = "Search" - UserOperationResolveObject UserOperation = "ResolveObject" - UserOperationMarkAllAsRead UserOperation = "MarkAllAsRead" - UserOperationSaveUserSettings UserOperation = "SaveUserSettings" - UserOperationTransferCommunity UserOperation = "TransferCommunity" - UserOperationLeaveAdmin UserOperation = "LeaveAdmin" - UserOperationPasswordReset UserOperation = "PasswordReset" - UserOperationPasswordChange UserOperation = "PasswordChange" - UserOperationMarkPrivateMessageAsRead UserOperation = "MarkPrivateMessageAsRead" - UserOperationUserJoin UserOperation = "UserJoin" - UserOperationGetSiteConfig UserOperation = "GetSiteConfig" - UserOperationSaveSiteConfig UserOperation = "SaveSiteConfig" - UserOperationPostJoin UserOperation = "PostJoin" - UserOperationCommunityJoin UserOperation = "CommunityJoin" - UserOperationModJoin UserOperation = "ModJoin" - UserOperationChangePassword UserOperation = "ChangePassword" - UserOperationGetSiteMetadata UserOperation = "GetSiteMetadata" - UserOperationBlockCommunity UserOperation = "BlockCommunity" - UserOperationBlockPerson UserOperation = "BlockPerson" -) - -type UserOperationCRUD string - -const ( - UserOperationCRUDCreateSite UserOperationCRUD = "CreateSite" - UserOperationCRUDGetSite UserOperationCRUD = "GetSite" - UserOperationCRUDEditSite UserOperationCRUD = "EditSite" - UserOperationCRUDCreateCommunity UserOperationCRUD = "CreateCommunity" - UserOperationCRUDListCommunities UserOperationCRUD = "ListCommunities" - UserOperationCRUDGetCommunity UserOperationCRUD = "GetCommunity" - UserOperationCRUDEditCommunity UserOperationCRUD = "EditCommunity" - UserOperationCRUDDeleteCommunity UserOperationCRUD = "DeleteCommunity" - UserOperationCRUDRemoveCommunity UserOperationCRUD = "RemoveCommunity" - UserOperationCRUDCreatePost UserOperationCRUD = "CreatePost" - UserOperationCRUDGetPost UserOperationCRUD = "GetPost" - UserOperationCRUDGetPosts UserOperationCRUD = "GetPosts" - UserOperationCRUDEditPost UserOperationCRUD = "EditPost" - UserOperationCRUDDeletePost UserOperationCRUD = "DeletePost" - UserOperationCRUDRemovePost UserOperationCRUD = "RemovePost" - UserOperationCRUDCreateComment UserOperationCRUD = "CreateComment" - UserOperationCRUDGetComment UserOperationCRUD = "GetComment" - UserOperationCRUDGetComments UserOperationCRUD = "GetComments" - UserOperationCRUDEditComment UserOperationCRUD = "EditComment" - UserOperationCRUDDeleteComment UserOperationCRUD = "DeleteComment" - UserOperationCRUDRemoveComment UserOperationCRUD = "RemoveComment" - UserOperationCRUDRegister UserOperationCRUD = "Register" - UserOperationCRUDGetPersonDetails UserOperationCRUD = "GetPersonDetails" - UserOperationCRUDDeleteAccount UserOperationCRUD = "DeleteAccount" - UserOperationCRUDCreatePrivateMessage UserOperationCRUD = "CreatePrivateMessage" - UserOperationCRUDGetPrivateMessages UserOperationCRUD = "GetPrivateMessages" - UserOperationCRUDEditPrivateMessage UserOperationCRUD = "EditPrivateMessage" - UserOperationCRUDDeletePrivateMessage UserOperationCRUD = "DeletePrivateMessage" -) diff --git a/types/local_site.gen.go b/types/local_site.gen.go new file mode 100644 index 0000000..318af7a --- /dev/null +++ b/types/local_site.gen.go @@ -0,0 +1,84 @@ +// Source: lemmy/crates/db_schema/src/source/local_site.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types + +type LocalSite struct { + ID int `json:"id" url:"id,omitempty"` + SiteID int `json:"site_id" url:"site_id,omitempty"` + SiteSetup bool `json:"site_setup" url:"site_setup,omitempty"` + EnableDownvotes bool `json:"enable_downvotes" url:"enable_downvotes,omitempty"` + EnableNSFW bool `json:"enable_nsfw" url:"enable_nsfw,omitempty"` + CommunityCreationAdminOnly bool `json:"community_creation_admin_only" url:"community_creation_admin_only,omitempty"` + RequireEmailVerification bool `json:"require_email_verification" url:"require_email_verification,omitempty"` + ApplicationQuestion Optional[string] `json:"application_question" url:"application_question,omitempty"` + PrivateInstance bool `json:"private_instance" url:"private_instance,omitempty"` + DefaultTheme string `json:"default_theme" url:"default_theme,omitempty"` + DefaultPostListingType string `json:"default_post_listing_type" url:"default_post_listing_type,omitempty"` + LegalInformation Optional[string] `json:"legal_information" url:"legal_information,omitempty"` + HideModlogModNames bool `json:"hide_modlog_mod_names" url:"hide_modlog_mod_names,omitempty"` + ApplicationEmailAdmins bool `json:"application_email_admins" url:"application_email_admins,omitempty"` + SlurFilterRegex Optional[string] `json:"slur_filter_regex" url:"slur_filter_regex,omitempty"` + ActorNameMaxLength int32 `json:"actor_name_max_length" url:"actor_name_max_length,omitempty"` + FederationEnabled bool `json:"federation_enabled" url:"federation_enabled,omitempty"` + FederationDebug bool `json:"federation_debug" url:"federation_debug,omitempty"` + FederationWorkerCount int32 `json:"federation_worker_count" url:"federation_worker_count,omitempty"` + CaptchaEnabled bool `json:"captcha_enabled" url:"captcha_enabled,omitempty"` + CaptchaDifficulty string `json:"captcha_difficulty" url:"captcha_difficulty,omitempty"` + RegistrationMode RegistrationMode `json:"registration_mode" url:"registration_mode,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` +} +type LocalSiteInsertForm struct { + SiteID int `json:"site_id" url:"site_id,omitempty"` + SiteSetup Optional[bool] `json:"site_setup" url:"site_setup,omitempty"` + EnableDownvotes Optional[bool] `json:"enable_downvotes" url:"enable_downvotes,omitempty"` + EnableNSFW Optional[bool] `json:"enable_nsfw" url:"enable_nsfw,omitempty"` + CommunityCreationAdminOnly Optional[bool] `json:"community_creation_admin_only" url:"community_creation_admin_only,omitempty"` + RequireEmailVerification Optional[bool] `json:"require_email_verification" url:"require_email_verification,omitempty"` + ApplicationQuestion Optional[string] `json:"application_question" url:"application_question,omitempty"` + PrivateInstance Optional[bool] `json:"private_instance" url:"private_instance,omitempty"` + DefaultTheme Optional[string] `json:"default_theme" url:"default_theme,omitempty"` + DefaultPostListingType Optional[string] `json:"default_post_listing_type" url:"default_post_listing_type,omitempty"` + LegalInformation Optional[string] `json:"legal_information" url:"legal_information,omitempty"` + HideModlogModNames Optional[bool] `json:"hide_modlog_mod_names" url:"hide_modlog_mod_names,omitempty"` + ApplicationEmailAdmins Optional[bool] `json:"application_email_admins" url:"application_email_admins,omitempty"` + SlurFilterRegex Optional[string] `json:"slur_filter_regex" url:"slur_filter_regex,omitempty"` + ActorNameMaxLength Optional[int32] `json:"actor_name_max_length" url:"actor_name_max_length,omitempty"` + FederationEnabled Optional[bool] `json:"federation_enabled" url:"federation_enabled,omitempty"` + FederationDebug Optional[bool] `json:"federation_debug" url:"federation_debug,omitempty"` + FederationWorkerCount Optional[int32] `json:"federation_worker_count" url:"federation_worker_count,omitempty"` + CaptchaEnabled Optional[bool] `json:"captcha_enabled" url:"captcha_enabled,omitempty"` + CaptchaDifficulty Optional[string] `json:"captcha_difficulty" url:"captcha_difficulty,omitempty"` + RegistrationMode Optional[RegistrationMode] `json:"registration_mode" url:"registration_mode,omitempty"` +} +type LocalSiteUpdateForm struct { + SiteSetup Optional[bool] `json:"site_setup" url:"site_setup,omitempty"` + EnableDownvotes Optional[bool] `json:"enable_downvotes" url:"enable_downvotes,omitempty"` + EnableNSFW Optional[bool] `json:"enable_nsfw" url:"enable_nsfw,omitempty"` + CommunityCreationAdminOnly Optional[bool] `json:"community_creation_admin_only" url:"community_creation_admin_only,omitempty"` + RequireEmailVerification Optional[bool] `json:"require_email_verification" url:"require_email_verification,omitempty"` + ApplicationQuestion Optional[Optional[string]] `json:"application_question" url:"application_question,omitempty"` + PrivateInstance Optional[bool] `json:"private_instance" url:"private_instance,omitempty"` + DefaultTheme Optional[string] `json:"default_theme" url:"default_theme,omitempty"` + DefaultPostListingType Optional[string] `json:"default_post_listing_type" url:"default_post_listing_type,omitempty"` + LegalInformation Optional[Optional[string]] `json:"legal_information" url:"legal_information,omitempty"` + HideModlogModNames Optional[bool] `json:"hide_modlog_mod_names" url:"hide_modlog_mod_names,omitempty"` + ApplicationEmailAdmins Optional[bool] `json:"application_email_admins" url:"application_email_admins,omitempty"` + SlurFilterRegex Optional[Optional[string]] `json:"slur_filter_regex" url:"slur_filter_regex,omitempty"` + ActorNameMaxLength Optional[int32] `json:"actor_name_max_length" url:"actor_name_max_length,omitempty"` + FederationEnabled Optional[bool] `json:"federation_enabled" url:"federation_enabled,omitempty"` + FederationDebug Optional[bool] `json:"federation_debug" url:"federation_debug,omitempty"` + FederationWorkerCount Optional[int32] `json:"federation_worker_count" url:"federation_worker_count,omitempty"` + CaptchaEnabled Optional[bool] `json:"captcha_enabled" url:"captcha_enabled,omitempty"` + CaptchaDifficulty Optional[string] `json:"captcha_difficulty" url:"captcha_difficulty,omitempty"` + RegistrationMode Optional[RegistrationMode] `json:"registration_mode" url:"registration_mode,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` +} +type RegistrationMode string + +const ( + RegistrationModeClosed RegistrationMode = "Closed" + RegistrationModeRequireApplication RegistrationMode = "RequireApplication" + RegistrationModeOpen RegistrationMode = "Open" +) diff --git a/types/local_site_rate_limit.gen.go b/types/local_site_rate_limit.gen.go new file mode 100644 index 0000000..5673ee6 --- /dev/null +++ b/types/local_site_rate_limit.gen.go @@ -0,0 +1,53 @@ +// Source: lemmy/crates/db_schema/src/source/local_site_rate_limit.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types + +type LocalSiteRateLimit struct { + ID int32 `json:"id" url:"id,omitempty"` + LocalSiteID int `json:"local_site_id" url:"local_site_id,omitempty"` + Message int32 `json:"message" url:"message,omitempty"` + MessagePerSecond int32 `json:"message_per_second" url:"message_per_second,omitempty"` + Post int32 `json:"post" url:"post,omitempty"` + PostPerSecond int32 `json:"post_per_second" url:"post_per_second,omitempty"` + Register int32 `json:"register" url:"register,omitempty"` + RegisterPerSecond int32 `json:"register_per_second" url:"register_per_second,omitempty"` + Image int32 `json:"image" url:"image,omitempty"` + ImagePerSecond int32 `json:"image_per_second" url:"image_per_second,omitempty"` + Comment int32 `json:"comment" url:"comment,omitempty"` + CommentPerSecond int32 `json:"comment_per_second" url:"comment_per_second,omitempty"` + Search int32 `json:"search" url:"search,omitempty"` + SearchPerSecond int32 `json:"search_per_second" url:"search_per_second,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` +} +type LocalSiteRateLimitInsertForm struct { + LocalSiteID int `json:"local_site_id" url:"local_site_id,omitempty"` + Message Optional[int32] `json:"message" url:"message,omitempty"` + MessagePerSecond Optional[int32] `json:"message_per_second" url:"message_per_second,omitempty"` + Post Optional[int32] `json:"post" url:"post,omitempty"` + PostPerSecond Optional[int32] `json:"post_per_second" url:"post_per_second,omitempty"` + Register Optional[int32] `json:"register" url:"register,omitempty"` + RegisterPerSecond Optional[int32] `json:"register_per_second" url:"register_per_second,omitempty"` + Image Optional[int32] `json:"image" url:"image,omitempty"` + ImagePerSecond Optional[int32] `json:"image_per_second" url:"image_per_second,omitempty"` + Comment Optional[int32] `json:"comment" url:"comment,omitempty"` + CommentPerSecond Optional[int32] `json:"comment_per_second" url:"comment_per_second,omitempty"` + Search Optional[int32] `json:"search" url:"search,omitempty"` + SearchPerSecond Optional[int32] `json:"search_per_second" url:"search_per_second,omitempty"` +} +type LocalSiteRateLimitUpdateForm struct { + Message Optional[int32] `json:"message" url:"message,omitempty"` + MessagePerSecond Optional[int32] `json:"message_per_second" url:"message_per_second,omitempty"` + Post Optional[int32] `json:"post" url:"post,omitempty"` + PostPerSecond Optional[int32] `json:"post_per_second" url:"post_per_second,omitempty"` + Register Optional[int32] `json:"register" url:"register,omitempty"` + RegisterPerSecond Optional[int32] `json:"register_per_second" url:"register_per_second,omitempty"` + Image Optional[int32] `json:"image" url:"image,omitempty"` + ImagePerSecond Optional[int32] `json:"image_per_second" url:"image_per_second,omitempty"` + Comment Optional[int32] `json:"comment" url:"comment,omitempty"` + CommentPerSecond Optional[int32] `json:"comment_per_second" url:"comment_per_second,omitempty"` + Search Optional[int32] `json:"search" url:"search,omitempty"` + SearchPerSecond Optional[int32] `json:"search_per_second" url:"search_per_second,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` +} diff --git a/types/local_user.gen.go b/types/local_user.gen.go index ef4bb75..76cc095 100644 --- a/types/local_user.gen.go +++ b/types/local_user.gen.go @@ -12,7 +12,7 @@ type LocalUser struct { Theme string `json:"theme" url:"theme,omitempty"` DefaultSortType int16 `json:"default_sort_type" url:"default_sort_type,omitempty"` DefaultListingType int16 `json:"default_listing_type" url:"default_listing_type,omitempty"` - Lang string `json:"lang" url:"lang,omitempty"` + InterfaceLanguage string `json:"interface_language" url:"interface_language,omitempty"` ShowAvatars bool `json:"show_avatars" url:"show_avatars,omitempty"` SendNotificationsToEmail bool `json:"send_notifications_to_email" url:"send_notifications_to_email,omitempty"` ValidatorTime LemmyTime `json:"validator_time" url:"validator_time,omitempty"` @@ -23,24 +23,6 @@ type LocalUser struct { EmailVerified bool `json:"email_verified" url:"email_verified,omitempty"` AcceptedApplication bool `json:"accepted_application" url:"accepted_application,omitempty"` } -type LocalUserForm struct { - PersonID Optional[int] `json:"person_id" url:"person_id,omitempty"` - PasswordEncrypted Optional[string] `json:"password_encrypted" url:"password_encrypted,omitempty"` - Email Optional[Optional[string]] `json:"email" url:"email,omitempty"` - ShowNSFW Optional[bool] `json:"show_nsfw" url:"show_nsfw,omitempty"` - Theme Optional[string] `json:"theme" url:"theme,omitempty"` - DefaultSortType Optional[int16] `json:"default_sort_type" url:"default_sort_type,omitempty"` - DefaultListingType Optional[int16] `json:"default_listing_type" url:"default_listing_type,omitempty"` - Lang Optional[string] `json:"lang" url:"lang,omitempty"` - ShowAvatars Optional[bool] `json:"show_avatars" url:"show_avatars,omitempty"` - SendNotificationsToEmail Optional[bool] `json:"send_notifications_to_email" url:"send_notifications_to_email,omitempty"` - ShowBotAccounts Optional[bool] `json:"show_bot_accounts" url:"show_bot_accounts,omitempty"` - ShowScores Optional[bool] `json:"show_scores" url:"show_scores,omitempty"` - ShowReadPosts Optional[bool] `json:"show_read_posts" url:"show_read_posts,omitempty"` - ShowNewPostNotifs Optional[bool] `json:"show_new_post_notifs" url:"show_new_post_notifs,omitempty"` - EmailVerified Optional[bool] `json:"email_verified" url:"email_verified,omitempty"` - AcceptedApplication Optional[bool] `json:"accepted_application" url:"accepted_application,omitempty"` -} type LocalUserSettings struct { ID int `json:"id" url:"id,omitempty"` PersonID int `json:"person_id" url:"person_id,omitempty"` @@ -49,7 +31,7 @@ type LocalUserSettings struct { Theme string `json:"theme" url:"theme,omitempty"` DefaultSortType int16 `json:"default_sort_type" url:"default_sort_type,omitempty"` DefaultListingType int16 `json:"default_listing_type" url:"default_listing_type,omitempty"` - Lang string `json:"lang" url:"lang,omitempty"` + InterfaceLanguage string `json:"interface_language" url:"interface_language,omitempty"` ShowAvatars bool `json:"show_avatars" url:"show_avatars,omitempty"` SendNotificationsToEmail bool `json:"send_notifications_to_email" url:"send_notifications_to_email,omitempty"` ValidatorTime LemmyTime `json:"validator_time" url:"validator_time,omitempty"` @@ -60,3 +42,38 @@ type LocalUserSettings struct { EmailVerified bool `json:"email_verified" url:"email_verified,omitempty"` AcceptedApplication bool `json:"accepted_application" url:"accepted_application,omitempty"` } +type LocalUserInsertForm struct { + PersonID int `json:"person_id" url:"person_id,omitempty"` + PasswordEncrypted string `json:"password_encrypted" url:"password_encrypted,omitempty"` + Email Optional[string] `json:"email" url:"email,omitempty"` + ShowNSFW Optional[bool] `json:"show_nsfw" url:"show_nsfw,omitempty"` + Theme Optional[string] `json:"theme" url:"theme,omitempty"` + DefaultSortType Optional[int16] `json:"default_sort_type" url:"default_sort_type,omitempty"` + DefaultListingType Optional[int16] `json:"default_listing_type" url:"default_listing_type,omitempty"` + InterfaceLanguage Optional[string] `json:"interface_language" url:"interface_language,omitempty"` + ShowAvatars Optional[bool] `json:"show_avatars" url:"show_avatars,omitempty"` + SendNotificationsToEmail Optional[bool] `json:"send_notifications_to_email" url:"send_notifications_to_email,omitempty"` + ShowBotAccounts Optional[bool] `json:"show_bot_accounts" url:"show_bot_accounts,omitempty"` + ShowScores Optional[bool] `json:"show_scores" url:"show_scores,omitempty"` + ShowReadPosts Optional[bool] `json:"show_read_posts" url:"show_read_posts,omitempty"` + ShowNewPostNotifs Optional[bool] `json:"show_new_post_notifs" url:"show_new_post_notifs,omitempty"` + EmailVerified Optional[bool] `json:"email_verified" url:"email_verified,omitempty"` + AcceptedApplication Optional[bool] `json:"accepted_application" url:"accepted_application,omitempty"` +} +type LocalUserUpdateForm struct { + PasswordEncrypted Optional[string] `json:"password_encrypted" url:"password_encrypted,omitempty"` + Email Optional[Optional[string]] `json:"email" url:"email,omitempty"` + ShowNSFW Optional[bool] `json:"show_nsfw" url:"show_nsfw,omitempty"` + Theme Optional[string] `json:"theme" url:"theme,omitempty"` + DefaultSortType Optional[int16] `json:"default_sort_type" url:"default_sort_type,omitempty"` + DefaultListingType Optional[int16] `json:"default_listing_type" url:"default_listing_type,omitempty"` + InterfaceLanguage Optional[string] `json:"interface_language" url:"interface_language,omitempty"` + ShowAvatars Optional[bool] `json:"show_avatars" url:"show_avatars,omitempty"` + SendNotificationsToEmail Optional[bool] `json:"send_notifications_to_email" url:"send_notifications_to_email,omitempty"` + ShowBotAccounts Optional[bool] `json:"show_bot_accounts" url:"show_bot_accounts,omitempty"` + ShowScores Optional[bool] `json:"show_scores" url:"show_scores,omitempty"` + ShowReadPosts Optional[bool] `json:"show_read_posts" url:"show_read_posts,omitempty"` + ShowNewPostNotifs Optional[bool] `json:"show_new_post_notifs" url:"show_new_post_notifs,omitempty"` + EmailVerified Optional[bool] `json:"email_verified" url:"email_verified,omitempty"` + AcceptedApplication Optional[bool] `json:"accepted_application" url:"accepted_application,omitempty"` +} diff --git a/types/mod.1.gen.go b/types/mod.1.gen.go new file mode 100644 index 0000000..d4cf02a --- /dev/null +++ b/types/mod.1.gen.go @@ -0,0 +1,4 @@ +// Source: lemmy/crates/db_schema/src/source/mod.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types diff --git a/types/mod.gen.go b/types/mod.gen.go index d4cf02a..a4823bf 100644 --- a/types/mod.gen.go +++ b/types/mod.gen.go @@ -1,4 +1,103 @@ -// Source: lemmy/crates/db_schema/src/source/mod.rs +// Source: lemmy/crates/api_common/src/websocket/mod.rs // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. package types + +type UserOperation string + +const ( + UserOperationLogin UserOperation = "Login" + UserOperationGetCaptcha UserOperation = "GetCaptcha" + UserOperationSaveComment UserOperation = "SaveComment" + UserOperationCreateCommentLike UserOperation = "CreateCommentLike" + UserOperationCreateCommentReport UserOperation = "CreateCommentReport" + UserOperationResolveCommentReport UserOperation = "ResolveCommentReport" + UserOperationListCommentReports UserOperation = "ListCommentReports" + UserOperationCreatePostLike UserOperation = "CreatePostLike" + UserOperationLockPost UserOperation = "LockPost" + UserOperationFeaturePost UserOperation = "FeaturePost" + UserOperationMarkPostAsRead UserOperation = "MarkPostAsRead" + UserOperationSavePost UserOperation = "SavePost" + UserOperationCreatePostReport UserOperation = "CreatePostReport" + UserOperationResolvePostReport UserOperation = "ResolvePostReport" + UserOperationListPostReports UserOperation = "ListPostReports" + UserOperationGetReportCount UserOperation = "GetReportCount" + UserOperationGetUnreadCount UserOperation = "GetUnreadCount" + UserOperationVerifyEmail UserOperation = "VerifyEmail" + UserOperationFollowCommunity UserOperation = "FollowCommunity" + UserOperationGetReplies UserOperation = "GetReplies" + UserOperationGetPersonMentions UserOperation = "GetPersonMentions" + UserOperationMarkPersonMentionAsRead UserOperation = "MarkPersonMentionAsRead" + UserOperationMarkCommentReplyAsRead UserOperation = "MarkCommentReplyAsRead" + UserOperationGetModlog UserOperation = "GetModlog" + UserOperationBanFromCommunity UserOperation = "BanFromCommunity" + UserOperationAddModToCommunity UserOperation = "AddModToCommunity" + UserOperationAddAdmin UserOperation = "AddAdmin" + UserOperationGetUnreadRegistrationApplicationCount UserOperation = "GetUnreadRegistrationApplicationCount" + UserOperationListRegistrationApplications UserOperation = "ListRegistrationApplications" + UserOperationApproveRegistrationApplication UserOperation = "ApproveRegistrationApplication" + UserOperationBanPerson UserOperation = "BanPerson" + UserOperationGetBannedPersons UserOperation = "GetBannedPersons" + UserOperationMarkAllAsRead UserOperation = "MarkAllAsRead" + UserOperationSaveUserSettings UserOperation = "SaveUserSettings" + UserOperationTransferCommunity UserOperation = "TransferCommunity" + UserOperationLeaveAdmin UserOperation = "LeaveAdmin" + UserOperationPasswordReset UserOperation = "PasswordReset" + UserOperationPasswordChange UserOperation = "PasswordChange" + UserOperationMarkPrivateMessageAsRead UserOperation = "MarkPrivateMessageAsRead" + UserOperationCreatePrivateMessageReport UserOperation = "CreatePrivateMessageReport" + UserOperationResolvePrivateMessageReport UserOperation = "ResolvePrivateMessageReport" + UserOperationListPrivateMessageReports UserOperation = "ListPrivateMessageReports" + UserOperationUserJoin UserOperation = "UserJoin" + UserOperationPostJoin UserOperation = "PostJoin" + UserOperationCommunityJoin UserOperation = "CommunityJoin" + UserOperationModJoin UserOperation = "ModJoin" + UserOperationChangePassword UserOperation = "ChangePassword" + UserOperationGetSiteMetadata UserOperation = "GetSiteMetadata" + UserOperationBlockCommunity UserOperation = "BlockCommunity" + UserOperationBlockPerson UserOperation = "BlockPerson" + UserOperationPurgePerson UserOperation = "PurgePerson" + UserOperationPurgeCommunity UserOperation = "PurgeCommunity" + UserOperationPurgePost UserOperation = "PurgePost" + UserOperationPurgeComment UserOperation = "PurgeComment" +) + +type UserOperationCRUD string + +const ( + UserOperationCRUDCreateSite UserOperationCRUD = "CreateSite" + UserOperationCRUDGetSite UserOperationCRUD = "GetSite" + UserOperationCRUDEditSite UserOperationCRUD = "EditSite" + UserOperationCRUDCreateCommunity UserOperationCRUD = "CreateCommunity" + UserOperationCRUDListCommunities UserOperationCRUD = "ListCommunities" + UserOperationCRUDEditCommunity UserOperationCRUD = "EditCommunity" + UserOperationCRUDDeleteCommunity UserOperationCRUD = "DeleteCommunity" + UserOperationCRUDRemoveCommunity UserOperationCRUD = "RemoveCommunity" + UserOperationCRUDCreatePost UserOperationCRUD = "CreatePost" + UserOperationCRUDGetPost UserOperationCRUD = "GetPost" + UserOperationCRUDEditPost UserOperationCRUD = "EditPost" + UserOperationCRUDDeletePost UserOperationCRUD = "DeletePost" + UserOperationCRUDRemovePost UserOperationCRUD = "RemovePost" + UserOperationCRUDCreateComment UserOperationCRUD = "CreateComment" + UserOperationCRUDGetComment UserOperationCRUD = "GetComment" + UserOperationCRUDEditComment UserOperationCRUD = "EditComment" + UserOperationCRUDDeleteComment UserOperationCRUD = "DeleteComment" + UserOperationCRUDRemoveComment UserOperationCRUD = "RemoveComment" + UserOperationCRUDRegister UserOperationCRUD = "Register" + UserOperationCRUDDeleteAccount UserOperationCRUD = "DeleteAccount" + UserOperationCRUDCreatePrivateMessage UserOperationCRUD = "CreatePrivateMessage" + UserOperationCRUDGetPrivateMessages UserOperationCRUD = "GetPrivateMessages" + UserOperationCRUDEditPrivateMessage UserOperationCRUD = "EditPrivateMessage" + UserOperationCRUDDeletePrivateMessage UserOperationCRUD = "DeletePrivateMessage" +) + +type UserOperationApub string + +const ( + UserOperationApubGetPosts UserOperationApub = "GetPosts" + UserOperationApubGetCommunity UserOperationApub = "GetCommunity" + UserOperationApubGetComments UserOperationApub = "GetComments" + UserOperationApubGetPersonDetails UserOperationApub = "GetPersonDetails" + UserOperationApubSearch UserOperationApub = "Search" + UserOperationApubResolveObject UserOperationApub = "ResolveObject" +) diff --git a/types/moderator.gen.go b/types/moderator.gen.go index 0e047b4..e0c1202 100644 --- a/types/moderator.gen.go +++ b/types/moderator.gen.go @@ -29,17 +29,19 @@ type ModLockPostForm struct { PostID int `json:"post_id" url:"post_id,omitempty"` Locked Optional[bool] `json:"locked" url:"locked,omitempty"` } -type ModStickyPost struct { - ID int32 `json:"id" url:"id,omitempty"` - ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"` - PostID int `json:"post_id" url:"post_id,omitempty"` - Stickied Optional[bool] `json:"stickied" url:"stickied,omitempty"` - When LemmyTime `json:"when_" url:"when_,omitempty"` +type ModFeaturePost struct { + ID int32 `json:"id" url:"id,omitempty"` + ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"` + PostID int `json:"post_id" url:"post_id,omitempty"` + Featured bool `json:"featured" url:"featured,omitempty"` + When LemmyTime `json:"when_" url:"when_,omitempty"` + IsFeaturedCommunity bool `json:"is_featured_community" url:"is_featured_community,omitempty"` } -type ModStickyPostForm struct { - ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"` - PostID int `json:"post_id" url:"post_id,omitempty"` - Stickied Optional[bool] `json:"stickied" url:"stickied,omitempty"` +type ModFeaturePostForm struct { + ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"` + PostID int `json:"post_id" url:"post_id,omitempty"` + Featured bool `json:"featured" url:"featured,omitempty"` + IsFeaturedCommunity bool `json:"is_featured_community" url:"is_featured_community,omitempty"` } type ModRemoveComment struct { ID int32 `json:"id" url:"id,omitempty"` @@ -159,3 +161,47 @@ type ModAddForm struct { OtherPersonID int `json:"other_person_id" url:"other_person_id,omitempty"` Removed Optional[bool] `json:"removed" url:"removed,omitempty"` } +type AdminPurgePerson struct { + ID int32 `json:"id" url:"id,omitempty"` + AdminPersonID int `json:"admin_person_id" url:"admin_person_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + When LemmyTime `json:"when_" url:"when_,omitempty"` +} +type AdminPurgePersonForm struct { + AdminPersonID int `json:"admin_person_id" url:"admin_person_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` +} +type AdminPurgeCommunity struct { + ID int32 `json:"id" url:"id,omitempty"` + AdminPersonID int `json:"admin_person_id" url:"admin_person_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + When LemmyTime `json:"when_" url:"when_,omitempty"` +} +type AdminPurgeCommunityForm struct { + AdminPersonID int `json:"admin_person_id" url:"admin_person_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` +} +type AdminPurgePost struct { + ID int32 `json:"id" url:"id,omitempty"` + AdminPersonID int `json:"admin_person_id" url:"admin_person_id,omitempty"` + CommunityID int `json:"community_id" url:"community_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + When LemmyTime `json:"when_" url:"when_,omitempty"` +} +type AdminPurgePostForm struct { + AdminPersonID int `json:"admin_person_id" url:"admin_person_id,omitempty"` + CommunityID int `json:"community_id" url:"community_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` +} +type AdminPurgeComment struct { + ID int32 `json:"id" url:"id,omitempty"` + AdminPersonID int `json:"admin_person_id" url:"admin_person_id,omitempty"` + PostID int `json:"post_id" url:"post_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + When LemmyTime `json:"when_" url:"when_,omitempty"` +} +type AdminPurgeCommentForm struct { + AdminPersonID int `json:"admin_person_id" url:"admin_person_id,omitempty"` + PostID int `json:"post_id" url:"post_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` +} diff --git a/types/person.1.gen.go b/types/person.1.gen.go index ad86bc1..58ec22d 100644 --- a/types/person.1.gen.go +++ b/types/person.1.gen.go @@ -25,6 +25,7 @@ type Person struct { Admin bool `json:"admin" url:"admin,omitempty"` BotAccount bool `json:"bot_account" url:"bot_account,omitempty"` BanExpires LemmyTime `json:"ban_expires" url:"ban_expires,omitempty"` + InstanceID int `json:"instance_id" url:"instance_id,omitempty"` } type PersonSafe struct { ID int `json:"id" url:"id,omitempty"` @@ -45,105 +46,41 @@ type PersonSafe struct { Admin bool `json:"admin" url:"admin,omitempty"` BotAccount bool `json:"bot_account" url:"bot_account,omitempty"` BanExpires LemmyTime `json:"ban_expires" url:"ban_expires,omitempty"` + InstanceID int `json:"instance_id" url:"instance_id,omitempty"` } -type PersonAlias1 struct { - ID int `json:"id" url:"id,omitempty"` +type PersonInsertForm struct { Name string `json:"name" url:"name,omitempty"` + PublicKey string `json:"public_key" url:"public_key,omitempty"` + InstanceID int `json:"instance_id" url:"instance_id,omitempty"` DisplayName Optional[string] `json:"display_name" url:"display_name,omitempty"` Avatar Optional[string] `json:"avatar" url:"avatar,omitempty"` - Banned bool `json:"banned" url:"banned,omitempty"` + Banned Optional[bool] `json:"banned" url:"banned,omitempty"` Published LemmyTime `json:"published" url:"published,omitempty"` Updated LemmyTime `json:"updated" url:"updated,omitempty"` - ActorID string `json:"actor_id" url:"actor_id,omitempty"` + ActorID Optional[string] `json:"actor_id" url:"actor_id,omitempty"` Bio Optional[string] `json:"bio" url:"bio,omitempty"` - Local bool `json:"local" url:"local,omitempty"` + Local Optional[bool] `json:"local" url:"local,omitempty"` PrivateKey Optional[string] `json:"private_key" url:"private_key,omitempty"` - PublicKey string `json:"public_key" url:"public_key,omitempty"` LastRefreshedAt LemmyTime `json:"last_refreshed_at" url:"last_refreshed_at,omitempty"` Banner Optional[string] `json:"banner" url:"banner,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` - InboxURL string `json:"inbox_url" url:"inbox_url,omitempty"` + Deleted Optional[bool] `json:"deleted" url:"deleted,omitempty"` + InboxURL Optional[string] `json:"inbox_url" url:"inbox_url,omitempty"` SharedInboxURL Optional[string] `json:"shared_inbox_url" url:"shared_inbox_url,omitempty"` MatrixUserID Optional[string] `json:"matrix_user_id" url:"matrix_user_id,omitempty"` - Admin bool `json:"admin" url:"admin,omitempty"` - BotAccount bool `json:"bot_account" url:"bot_account,omitempty"` + Admin Optional[bool] `json:"admin" url:"admin,omitempty"` + BotAccount Optional[bool] `json:"bot_account" url:"bot_account,omitempty"` BanExpires LemmyTime `json:"ban_expires" url:"ban_expires,omitempty"` } -type PersonSafeAlias1 struct { - ID int `json:"id" url:"id,omitempty"` - Name string `json:"name" url:"name,omitempty"` - DisplayName Optional[string] `json:"display_name" url:"display_name,omitempty"` - Avatar Optional[string] `json:"avatar" url:"avatar,omitempty"` - Banned bool `json:"banned" url:"banned,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - Updated LemmyTime `json:"updated" url:"updated,omitempty"` - ActorID string `json:"actor_id" url:"actor_id,omitempty"` - Bio Optional[string] `json:"bio" url:"bio,omitempty"` - Local bool `json:"local" url:"local,omitempty"` - Banner Optional[string] `json:"banner" url:"banner,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` - InboxURL string `json:"inbox_url" url:"inbox_url,omitempty"` - SharedInboxURL Optional[string] `json:"shared_inbox_url" url:"shared_inbox_url,omitempty"` - MatrixUserID Optional[string] `json:"matrix_user_id" url:"matrix_user_id,omitempty"` - Admin bool `json:"admin" url:"admin,omitempty"` - BotAccount bool `json:"bot_account" url:"bot_account,omitempty"` - BanExpires LemmyTime `json:"ban_expires" url:"ban_expires,omitempty"` -} -type PersonAlias2 struct { - ID int `json:"id" url:"id,omitempty"` - Name string `json:"name" url:"name,omitempty"` - DisplayName Optional[string] `json:"display_name" url:"display_name,omitempty"` - Avatar Optional[string] `json:"avatar" url:"avatar,omitempty"` - Banned bool `json:"banned" url:"banned,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - Updated LemmyTime `json:"updated" url:"updated,omitempty"` - ActorID string `json:"actor_id" url:"actor_id,omitempty"` - Bio Optional[string] `json:"bio" url:"bio,omitempty"` - Local bool `json:"local" url:"local,omitempty"` - PrivateKey Optional[string] `json:"private_key" url:"private_key,omitempty"` - PublicKey string `json:"public_key" url:"public_key,omitempty"` - LastRefreshedAt LemmyTime `json:"last_refreshed_at" url:"last_refreshed_at,omitempty"` - Banner Optional[string] `json:"banner" url:"banner,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` - InboxURL string `json:"inbox_url" url:"inbox_url,omitempty"` - SharedInboxURL Optional[string] `json:"shared_inbox_url" url:"shared_inbox_url,omitempty"` - MatrixUserID Optional[string] `json:"matrix_user_id" url:"matrix_user_id,omitempty"` - Admin bool `json:"admin" url:"admin,omitempty"` - BotAccount bool `json:"bot_account" url:"bot_account,omitempty"` - BanExpires LemmyTime `json:"ban_expires" url:"ban_expires,omitempty"` -} -type PersonSafeAlias2 struct { - ID int `json:"id" url:"id,omitempty"` - Name string `json:"name" url:"name,omitempty"` - DisplayName Optional[string] `json:"display_name" url:"display_name,omitempty"` - Avatar Optional[string] `json:"avatar" url:"avatar,omitempty"` - Banned bool `json:"banned" url:"banned,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - Updated LemmyTime `json:"updated" url:"updated,omitempty"` - ActorID string `json:"actor_id" url:"actor_id,omitempty"` - Bio Optional[string] `json:"bio" url:"bio,omitempty"` - Local bool `json:"local" url:"local,omitempty"` - Banner Optional[string] `json:"banner" url:"banner,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` - InboxURL string `json:"inbox_url" url:"inbox_url,omitempty"` - SharedInboxURL Optional[string] `json:"shared_inbox_url" url:"shared_inbox_url,omitempty"` - MatrixUserID Optional[string] `json:"matrix_user_id" url:"matrix_user_id,omitempty"` - Admin bool `json:"admin" url:"admin,omitempty"` - BotAccount bool `json:"bot_account" url:"bot_account,omitempty"` - BanExpires LemmyTime `json:"ban_expires" url:"ban_expires,omitempty"` -} -type PersonForm struct { - Name string `json:"name" url:"name,omitempty"` +type PersonUpdateForm struct { DisplayName Optional[Optional[string]] `json:"display_name" url:"display_name,omitempty"` Avatar Optional[Optional[string]] `json:"avatar" url:"avatar,omitempty"` Banned Optional[bool] `json:"banned" url:"banned,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` Updated LemmyTime `json:"updated" url:"updated,omitempty"` ActorID Optional[string] `json:"actor_id" url:"actor_id,omitempty"` Bio Optional[Optional[string]] `json:"bio" url:"bio,omitempty"` Local Optional[bool] `json:"local" url:"local,omitempty"` - PrivateKey Optional[Optional[string]] `json:"private_key" url:"private_key,omitempty"` PublicKey Optional[string] `json:"public_key" url:"public_key,omitempty"` + PrivateKey Optional[Optional[string]] `json:"private_key" url:"private_key,omitempty"` LastRefreshedAt LemmyTime `json:"last_refreshed_at" url:"last_refreshed_at,omitempty"` Banner Optional[Optional[string]] `json:"banner" url:"banner,omitempty"` Deleted Optional[bool] `json:"deleted" url:"deleted,omitempty"` @@ -154,3 +91,15 @@ type PersonForm struct { BotAccount Optional[bool] `json:"bot_account" url:"bot_account,omitempty"` BanExpires LemmyTime `json:"ban_expires" url:"ban_expires,omitempty"` } +type PersonFollower struct { + ID int32 `json:"id" url:"id,omitempty"` + PersonID int `json:"person_id" url:"person_id,omitempty"` + FollowerID int `json:"follower_id" url:"follower_id,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Pending bool `json:"pending" url:"pending,omitempty"` +} +type PersonFollowerForm struct { + PersonID int `json:"person_id" url:"person_id,omitempty"` + FollowerID int `json:"follower_id" url:"follower_id,omitempty"` + Pending bool `json:"pending" url:"pending,omitempty"` +} diff --git a/types/person.gen.go b/types/person.gen.go index 5863b00..e80493d 100644 --- a/types/person.gen.go +++ b/types/person.gen.go @@ -35,7 +35,7 @@ type SaveUserSettings struct { Theme Optional[string] `json:"theme" url:"theme,omitempty"` DefaultSortType Optional[int16] `json:"default_sort_type" url:"default_sort_type,omitempty"` DefaultListingType Optional[int16] `json:"default_listing_type" url:"default_listing_type,omitempty"` - Lang Optional[string] `json:"lang" url:"lang,omitempty"` + InterfaceLanguage Optional[string] `json:"interface_language" url:"interface_language,omitempty"` Avatar Optional[string] `json:"avatar" url:"avatar,omitempty"` Banner Optional[string] `json:"banner" url:"banner,omitempty"` DisplayName Optional[string] `json:"display_name" url:"display_name,omitempty"` @@ -48,6 +48,7 @@ type SaveUserSettings struct { ShowBotAccounts Optional[bool] `json:"show_bot_accounts" url:"show_bot_accounts,omitempty"` ShowReadPosts Optional[bool] `json:"show_read_posts" url:"show_read_posts,omitempty"` ShowNewPostNotifs Optional[bool] `json:"show_new_post_notifs" url:"show_new_post_notifs,omitempty"` + DiscussionLanguages Optional[[]int] `json:"discussion_languages" url:"discussion_languages,omitempty"` Auth string `json:"auth" url:"auth,omitempty"` } type ChangePassword struct { @@ -80,7 +81,7 @@ type GetPersonDetailsResponse struct { LemmyResponse } type GetRepliesResponse struct { - Replies []CommentView `json:"replies" url:"replies,omitempty"` + Replies []CommentReplyView `json:"replies" url:"replies,omitempty"` LemmyResponse } type GetPersonMentionsResponse struct { @@ -130,18 +131,18 @@ type BlockPersonResponse struct { LemmyResponse } type GetReplies struct { - Sort Optional[SortType] `json:"sort" url:"sort,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` + Sort Optional[CommentSortType] `json:"sort" url:"sort,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` } type GetPersonMentions struct { - Sort Optional[SortType] `json:"sort" url:"sort,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` + Sort Optional[CommentSortType] `json:"sort" url:"sort,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` } type MarkPersonMentionAsRead struct { PersonMentionID int `json:"person_mention_id" url:"person_mention_id,omitempty"` @@ -152,6 +153,15 @@ type PersonMentionResponse struct { PersonMentionView PersonMentionView `json:"person_mention_view" url:"person_mention_view,omitempty"` LemmyResponse } +type MarkCommentReplyAsRead struct { + CommentReplyID int `json:"comment_reply_id" url:"comment_reply_id,omitempty"` + Read bool `json:"read" url:"read,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` +} +type CommentReplyResponse struct { + CommentReplyView CommentReplyView `json:"comment_reply_view" url:"comment_reply_view,omitempty"` + LemmyResponse +} type DeleteAccount struct { Password string `json:"password" url:"password,omitempty"` Auth string `json:"auth" url:"auth,omitempty"` @@ -170,48 +180,15 @@ type PasswordChangeAfterReset struct { Password string `json:"password" url:"password,omitempty"` PasswordVerify string `json:"password_verify" url:"password_verify,omitempty"` } -type CreatePrivateMessage struct { - Content string `json:"content" url:"content,omitempty"` - RecipientID int `json:"recipient_id" url:"recipient_id,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` -} -type EditPrivateMessage struct { - PrivateMessageID int `json:"private_message_id" url:"private_message_id,omitempty"` - Content string `json:"content" url:"content,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` -} -type DeletePrivateMessage struct { - PrivateMessageID int `json:"private_message_id" url:"private_message_id,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` -} -type MarkPrivateMessageAsRead struct { - PrivateMessageID int `json:"private_message_id" url:"private_message_id,omitempty"` - Read bool `json:"read" url:"read,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` -} -type GetPrivateMessages struct { - UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` -} -type PrivateMessagesResponse struct { - PrivateMessages []PrivateMessageView `json:"private_messages" url:"private_messages,omitempty"` - LemmyResponse -} -type PrivateMessageResponse struct { - PrivateMessageView PrivateMessageView `json:"private_message_view" url:"private_message_view,omitempty"` - LemmyResponse -} type GetReportCount struct { CommunityID Optional[int] `json:"community_id" url:"community_id,omitempty"` Auth string `json:"auth" url:"auth,omitempty"` } type GetReportCountResponse struct { - CommunityID Optional[int] `json:"community_id" url:"community_id,omitempty"` - CommentReports int64 `json:"comment_reports" url:"comment_reports,omitempty"` - PostReports int64 `json:"post_reports" url:"post_reports,omitempty"` + CommunityID Optional[int] `json:"community_id" url:"community_id,omitempty"` + CommentReports int64 `json:"comment_reports" url:"comment_reports,omitempty"` + PostReports int64 `json:"post_reports" url:"post_reports,omitempty"` + PrivateMessageReports Optional[int64] `json:"private_message_reports" url:"private_message_reports,omitempty"` LemmyResponse } type GetUnreadCount struct { diff --git a/types/person_mention.gen.go b/types/person_mention.gen.go index dd03a01..b402e83 100644 --- a/types/person_mention.gen.go +++ b/types/person_mention.gen.go @@ -10,8 +10,11 @@ type PersonMention struct { Read bool `json:"read" url:"read,omitempty"` Published LemmyTime `json:"published" url:"published,omitempty"` } -type PersonMentionForm struct { +type PersonMentionInsertForm struct { RecipientID int `json:"recipient_id" url:"recipient_id,omitempty"` CommentID int `json:"comment_id" url:"comment_id,omitempty"` Read Optional[bool] `json:"read" url:"read,omitempty"` } +type PersonMentionUpdateForm struct { + Read Optional[bool] `json:"read" url:"read,omitempty"` +} diff --git a/types/post.1.gen.go b/types/post.1.gen.go index 120d170..4f33ad2 100644 --- a/types/post.1.gen.go +++ b/types/post.1.gen.go @@ -4,45 +4,69 @@ package types type Post struct { - ID int `json:"id" url:"id,omitempty"` - Name string `json:"name" url:"name,omitempty"` - URL Optional[string] `json:"url" url:"url,omitempty"` - Body Optional[string] `json:"body" url:"body,omitempty"` - CreatorID int `json:"creator_id" url:"creator_id,omitempty"` - CommunityID int `json:"community_id" url:"community_id,omitempty"` - Removed bool `json:"removed" url:"removed,omitempty"` - Locked bool `json:"locked" url:"locked,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - Updated LemmyTime `json:"updated" url:"updated,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` - NSFW bool `json:"nsfw" url:"nsfw,omitempty"` - Stickied bool `json:"stickied" url:"stickied,omitempty"` - EmbedTitle Optional[string] `json:"embed_title" url:"embed_title,omitempty"` - EmbedDescription Optional[string] `json:"embed_description" url:"embed_description,omitempty"` - EmbedHtml Optional[string] `json:"embed_html" url:"embed_html,omitempty"` - ThumbnailURL Optional[string] `json:"thumbnail_url" url:"thumbnail_url,omitempty"` - ApID string `json:"ap_id" url:"ap_id,omitempty"` - Local bool `json:"local" url:"local,omitempty"` + ID int `json:"id" url:"id,omitempty"` + Name string `json:"name" url:"name,omitempty"` + URL Optional[string] `json:"url" url:"url,omitempty"` + Body Optional[string] `json:"body" url:"body,omitempty"` + CreatorID int `json:"creator_id" url:"creator_id,omitempty"` + CommunityID int `json:"community_id" url:"community_id,omitempty"` + Removed bool `json:"removed" url:"removed,omitempty"` + Locked bool `json:"locked" url:"locked,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + Deleted bool `json:"deleted" url:"deleted,omitempty"` + NSFW bool `json:"nsfw" url:"nsfw,omitempty"` + EmbedTitle Optional[string] `json:"embed_title" url:"embed_title,omitempty"` + EmbedDescription Optional[string] `json:"embed_description" url:"embed_description,omitempty"` + EmbedVideoURL Optional[string] `json:"embed_video_url" url:"embed_video_url,omitempty"` + ThumbnailURL Optional[string] `json:"thumbnail_url" url:"thumbnail_url,omitempty"` + ApID string `json:"ap_id" url:"ap_id,omitempty"` + Local bool `json:"local" url:"local,omitempty"` + LanguageID int `json:"language_id" url:"language_id,omitempty"` + FeaturedCommunity bool `json:"featured_community" url:"featured_community,omitempty"` + FeaturedLocal bool `json:"featured_local" url:"featured_local,omitempty"` } -type PostForm struct { - Name string `json:"name" url:"name,omitempty"` - CreatorID int `json:"creator_id" url:"creator_id,omitempty"` - CommunityID int `json:"community_id" url:"community_id,omitempty"` - NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` - URL Optional[string] `json:"url" url:"url,omitempty"` - Body Optional[string] `json:"body" url:"body,omitempty"` - Removed Optional[bool] `json:"removed" url:"removed,omitempty"` - Locked Optional[bool] `json:"locked" url:"locked,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - Updated LemmyTime `json:"updated" url:"updated,omitempty"` - Deleted Optional[bool] `json:"deleted" url:"deleted,omitempty"` - Stickied Optional[bool] `json:"stickied" url:"stickied,omitempty"` - EmbedTitle Optional[string] `json:"embed_title" url:"embed_title,omitempty"` - EmbedDescription Optional[string] `json:"embed_description" url:"embed_description,omitempty"` - EmbedHtml Optional[string] `json:"embed_html" url:"embed_html,omitempty"` - ThumbnailURL Optional[string] `json:"thumbnail_url" url:"thumbnail_url,omitempty"` - ApID Optional[string] `json:"ap_id" url:"ap_id,omitempty"` - Local Optional[bool] `json:"local" url:"local,omitempty"` +type PostInsertForm struct { + Name string `json:"name" url:"name,omitempty"` + CreatorID int `json:"creator_id" url:"creator_id,omitempty"` + CommunityID int `json:"community_id" url:"community_id,omitempty"` + NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` + URL Optional[string] `json:"url" url:"url,omitempty"` + Body Optional[string] `json:"body" url:"body,omitempty"` + Removed Optional[bool] `json:"removed" url:"removed,omitempty"` + Locked Optional[bool] `json:"locked" url:"locked,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Deleted Optional[bool] `json:"deleted" url:"deleted,omitempty"` + EmbedTitle Optional[string] `json:"embed_title" url:"embed_title,omitempty"` + EmbedDescription Optional[string] `json:"embed_description" url:"embed_description,omitempty"` + EmbedVideoURL Optional[string] `json:"embed_video_url" url:"embed_video_url,omitempty"` + ThumbnailURL Optional[string] `json:"thumbnail_url" url:"thumbnail_url,omitempty"` + ApID Optional[string] `json:"ap_id" url:"ap_id,omitempty"` + Local Optional[bool] `json:"local" url:"local,omitempty"` + LanguageID Optional[int] `json:"language_id" url:"language_id,omitempty"` + FeaturedCommunity Optional[bool] `json:"featured_community" url:"featured_community,omitempty"` + FeaturedLocal Optional[bool] `json:"featured_local" url:"featured_local,omitempty"` +} +type PostUpdateForm struct { + Name Optional[string] `json:"name" url:"name,omitempty"` + NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` + URL Optional[Optional[string]] `json:"url" url:"url,omitempty"` + Body Optional[Optional[string]] `json:"body" url:"body,omitempty"` + Removed Optional[bool] `json:"removed" url:"removed,omitempty"` + Locked Optional[bool] `json:"locked" url:"locked,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + Deleted Optional[bool] `json:"deleted" url:"deleted,omitempty"` + EmbedTitle Optional[Optional[string]] `json:"embed_title" url:"embed_title,omitempty"` + EmbedDescription Optional[Optional[string]] `json:"embed_description" url:"embed_description,omitempty"` + EmbedVideoURL Optional[Optional[string]] `json:"embed_video_url" url:"embed_video_url,omitempty"` + ThumbnailURL Optional[Optional[string]] `json:"thumbnail_url" url:"thumbnail_url,omitempty"` + ApID Optional[string] `json:"ap_id" url:"ap_id,omitempty"` + Local Optional[bool] `json:"local" url:"local,omitempty"` + LanguageID Optional[int] `json:"language_id" url:"language_id,omitempty"` + FeaturedCommunity Optional[bool] `json:"featured_community" url:"featured_community,omitempty"` + FeaturedLocal Optional[bool] `json:"featured_local" url:"featured_local,omitempty"` } type PostLike struct { ID int32 `json:"id" url:"id,omitempty"` diff --git a/types/post.gen.go b/types/post.gen.go index f7c047a..0ee5155 100644 --- a/types/post.gen.go +++ b/types/post.gen.go @@ -10,6 +10,7 @@ type CreatePost struct { Body Optional[string] `json:"body" url:"body,omitempty"` Honeypot Optional[string] `json:"honeypot" url:"honeypot,omitempty"` NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` + LanguageID Optional[int] `json:"language_id" url:"language_id,omitempty"` Auth string `json:"auth" url:"auth,omitempty"` } type PostResponse struct { @@ -17,13 +18,13 @@ type PostResponse struct { LemmyResponse } type GetPost struct { - ID int `json:"id" url:"id,omitempty"` - Auth Optional[string] `json:"auth" url:"auth,omitempty"` + ID Optional[int] `json:"id" url:"id,omitempty"` + CommentID Optional[int] `json:"comment_id" url:"comment_id,omitempty"` + Auth Optional[string] `json:"auth" url:"auth,omitempty"` } type GetPostResponse struct { PostView PostView `json:"post_view" url:"post_view,omitempty"` CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"` - Comments []CommentView `json:"comments" url:"comments,omitempty"` Moderators []CommunityModeratorView `json:"moderators" url:"moderators,omitempty"` Online uint `json:"online" url:"online,omitempty"` LemmyResponse @@ -48,12 +49,13 @@ type CreatePostLike struct { Auth string `json:"auth" url:"auth,omitempty"` } type EditPost struct { - PostID int `json:"post_id" url:"post_id,omitempty"` - Name Optional[string] `json:"name" url:"name,omitempty"` - URL Optional[string] `json:"url" url:"url,omitempty"` - Body Optional[string] `json:"body" url:"body,omitempty"` - NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` + PostID int `json:"post_id" url:"post_id,omitempty"` + Name Optional[string] `json:"name" url:"name,omitempty"` + URL Optional[string] `json:"url" url:"url,omitempty"` + Body Optional[string] `json:"body" url:"body,omitempty"` + NSFW Optional[bool] `json:"nsfw" url:"nsfw,omitempty"` + LanguageID Optional[int] `json:"language_id" url:"language_id,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` } type DeletePost struct { PostID int `json:"post_id" url:"post_id,omitempty"` @@ -76,10 +78,11 @@ type LockPost struct { Locked bool `json:"locked" url:"locked,omitempty"` Auth string `json:"auth" url:"auth,omitempty"` } -type StickyPost struct { - PostID int `json:"post_id" url:"post_id,omitempty"` - Stickied bool `json:"stickied" url:"stickied,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` +type FeaturePost struct { + PostID int `json:"post_id" url:"post_id,omitempty"` + Featured bool `json:"featured" url:"featured,omitempty"` + FeatureType PostFeatureType `json:"feature_type" url:"feature_type,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` } type SavePost struct { PostID int `json:"post_id" url:"post_id,omitempty"` @@ -119,8 +122,8 @@ type GetSiteMetadataResponse struct { LemmyResponse } type SiteMetadata struct { - Title Optional[string] `json:"title" url:"title,omitempty"` - Description Optional[string] `json:"description" url:"description,omitempty"` - Image Optional[string] `json:"image" url:"image,omitempty"` - Html Optional[string] `json:"html" url:"html,omitempty"` + Title Optional[string] `json:"title" url:"title,omitempty"` + Description Optional[string] `json:"description" url:"description,omitempty"` + Image Optional[string] `json:"image" url:"image,omitempty"` + EmbedVideoURL Optional[string] `json:"embed_video_url" url:"embed_video_url,omitempty"` } diff --git a/types/private_message.1.gen.go b/types/private_message.1.gen.go new file mode 100644 index 0000000..12035ef --- /dev/null +++ b/types/private_message.1.gen.go @@ -0,0 +1,37 @@ +// Source: lemmy/crates/db_schema/src/source/private_message.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types + +type PrivateMessage struct { + ID int `json:"id" url:"id,omitempty"` + CreatorID int `json:"creator_id" url:"creator_id,omitempty"` + RecipientID int `json:"recipient_id" url:"recipient_id,omitempty"` + Content string `json:"content" url:"content,omitempty"` + Deleted bool `json:"deleted" url:"deleted,omitempty"` + Read bool `json:"read" url:"read,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + ApID string `json:"ap_id" url:"ap_id,omitempty"` + Local bool `json:"local" url:"local,omitempty"` +} +type PrivateMessageInsertForm struct { + CreatorID int `json:"creator_id" url:"creator_id,omitempty"` + RecipientID int `json:"recipient_id" url:"recipient_id,omitempty"` + Content string `json:"content" url:"content,omitempty"` + Deleted Optional[bool] `json:"deleted" url:"deleted,omitempty"` + Read Optional[bool] `json:"read" url:"read,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + ApID Optional[string] `json:"ap_id" url:"ap_id,omitempty"` + Local Optional[bool] `json:"local" url:"local,omitempty"` +} +type PrivateMessageUpdateForm struct { + Content Optional[string] `json:"content" url:"content,omitempty"` + Deleted Optional[bool] `json:"deleted" url:"deleted,omitempty"` + Read Optional[bool] `json:"read" url:"read,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + ApID Optional[string] `json:"ap_id" url:"ap_id,omitempty"` + Local Optional[bool] `json:"local" url:"local,omitempty"` +} diff --git a/types/private_message.gen.go b/types/private_message.gen.go index 32e5586..c882fbd 100644 --- a/types/private_message.gen.go +++ b/types/private_message.gen.go @@ -1,28 +1,63 @@ -// Source: lemmy/crates/db_schema/src/source/private_message.rs +// Source: lemmy/crates/api_common/src/private_message.rs // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. package types -type PrivateMessage struct { - ID int `json:"id" url:"id,omitempty"` - CreatorID int `json:"creator_id" url:"creator_id,omitempty"` - RecipientID int `json:"recipient_id" url:"recipient_id,omitempty"` - Content string `json:"content" url:"content,omitempty"` - Deleted bool `json:"deleted" url:"deleted,omitempty"` - Read bool `json:"read" url:"read,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - Updated LemmyTime `json:"updated" url:"updated,omitempty"` - ApID string `json:"ap_id" url:"ap_id,omitempty"` - Local bool `json:"local" url:"local,omitempty"` +type CreatePrivateMessage struct { + Content string `json:"content" url:"content,omitempty"` + RecipientID int `json:"recipient_id" url:"recipient_id,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` } -type PrivateMessageForm struct { - CreatorID int `json:"creator_id" url:"creator_id,omitempty"` - RecipientID int `json:"recipient_id" url:"recipient_id,omitempty"` - Content string `json:"content" url:"content,omitempty"` - Deleted Optional[bool] `json:"deleted" url:"deleted,omitempty"` - Read Optional[bool] `json:"read" url:"read,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - Updated LemmyTime `json:"updated" url:"updated,omitempty"` - ApID Optional[string] `json:"ap_id" url:"ap_id,omitempty"` - Local Optional[bool] `json:"local" url:"local,omitempty"` +type EditPrivateMessage struct { + PrivateMessageID int `json:"private_message_id" url:"private_message_id,omitempty"` + Content string `json:"content" url:"content,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` +} +type DeletePrivateMessage struct { + PrivateMessageID int `json:"private_message_id" url:"private_message_id,omitempty"` + Deleted bool `json:"deleted" url:"deleted,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` +} +type MarkPrivateMessageAsRead struct { + PrivateMessageID int `json:"private_message_id" url:"private_message_id,omitempty"` + Read bool `json:"read" url:"read,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` +} +type GetPrivateMessages struct { + UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` +} +type PrivateMessagesResponse struct { + PrivateMessages []PrivateMessageView `json:"private_messages" url:"private_messages,omitempty"` + LemmyResponse +} +type PrivateMessageResponse struct { + PrivateMessageView PrivateMessageView `json:"private_message_view" url:"private_message_view,omitempty"` + LemmyResponse +} +type CreatePrivateMessageReport struct { + PrivateMessageID int `json:"private_message_id" url:"private_message_id,omitempty"` + Reason string `json:"reason" url:"reason,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` +} +type PrivateMessageReportResponse struct { + PrivateMessageReportView PrivateMessageReportView `json:"private_message_report_view" url:"private_message_report_view,omitempty"` + LemmyResponse +} +type ResolvePrivateMessageReport struct { + ReportID int `json:"report_id" url:"report_id,omitempty"` + Resolved bool `json:"resolved" url:"resolved,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` +} +type ListPrivateMessageReports struct { + Page Optional[int64] `json:"page" url:"page,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + UnresolvedOnly Optional[bool] `json:"unresolved_only" url:"unresolved_only,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` +} +type ListPrivateMessageReportsResponse struct { + PrivateMessageReports []PrivateMessageReportView `json:"private_message_reports" url:"private_message_reports,omitempty"` + LemmyResponse } diff --git a/types/private_message_report.gen.go b/types/private_message_report.gen.go new file mode 100644 index 0000000..4870236 --- /dev/null +++ b/types/private_message_report.gen.go @@ -0,0 +1,22 @@ +// Source: lemmy/crates/db_schema/src/source/private_message_report.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types + +type PrivateMessageReport struct { + ID int `json:"id" url:"id,omitempty"` + CreatorID int `json:"creator_id" url:"creator_id,omitempty"` + PrivateMessageID int `json:"private_message_id" url:"private_message_id,omitempty"` + OriginalPmText string `json:"original_pm_text" url:"original_pm_text,omitempty"` + Reason string `json:"reason" url:"reason,omitempty"` + Resolved bool `json:"resolved" url:"resolved,omitempty"` + ResolverID Optional[int] `json:"resolver_id" url:"resolver_id,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` +} +type PrivateMessageReportForm struct { + CreatorID int `json:"creator_id" url:"creator_id,omitempty"` + PrivateMessageID int `json:"private_message_id" url:"private_message_id,omitempty"` + OriginalPmText string `json:"original_pm_text" url:"original_pm_text,omitempty"` + Reason string `json:"reason" url:"reason,omitempty"` +} diff --git a/types/registration_application.gen.go b/types/registration_application.gen.go index ea50545..4b4fc30 100644 --- a/types/registration_application.gen.go +++ b/types/registration_application.gen.go @@ -11,9 +11,11 @@ type RegistrationApplication struct { DenyReason Optional[string] `json:"deny_reason" url:"deny_reason,omitempty"` Published LemmyTime `json:"published" url:"published,omitempty"` } -type RegistrationApplicationForm struct { - LocalUserID Optional[int] `json:"local_user_id" url:"local_user_id,omitempty"` - Answer Optional[string] `json:"answer" url:"answer,omitempty"` - AdminID Optional[int] `json:"admin_id" url:"admin_id,omitempty"` - DenyReason Optional[Optional[string]] `json:"deny_reason" url:"deny_reason,omitempty"` +type RegistrationApplicationInsertForm struct { + LocalUserID int `json:"local_user_id" url:"local_user_id,omitempty"` + Answer string `json:"answer" url:"answer,omitempty"` +} +type RegistrationApplicationUpdateForm struct { + AdminID Optional[Optional[int]] `json:"admin_id" url:"admin_id,omitempty"` + DenyReason Optional[Optional[string]] `json:"deny_reason" url:"deny_reason,omitempty"` } diff --git a/types/send.gen.go b/types/send.gen.go new file mode 100644 index 0000000..5bafb33 --- /dev/null +++ b/types/send.gen.go @@ -0,0 +1,4 @@ +// Source: lemmy/crates/api_common/src/websocket/send.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types diff --git a/types/site.1.gen.go b/types/site.1.gen.go index a66dffd..e5fc0e3 100644 --- a/types/site.1.gen.go +++ b/types/site.1.gen.go @@ -4,52 +4,45 @@ package types type Site struct { - ID int32 `json:"id" url:"id,omitempty"` - Name string `json:"name" url:"name,omitempty"` - Sidebar Optional[string] `json:"sidebar" url:"sidebar,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - Updated LemmyTime `json:"updated" url:"updated,omitempty"` - EnableDownvotes bool `json:"enable_downvotes" url:"enable_downvotes,omitempty"` - OpenRegistration bool `json:"open_registration" url:"open_registration,omitempty"` - EnableNSFW bool `json:"enable_nsfw" url:"enable_nsfw,omitempty"` - Icon Optional[string] `json:"icon" url:"icon,omitempty"` - Banner Optional[string] `json:"banner" url:"banner,omitempty"` - Description Optional[string] `json:"description" url:"description,omitempty"` - CommunityCreationAdminOnly bool `json:"community_creation_admin_only" url:"community_creation_admin_only,omitempty"` - RequireEmailVerification bool `json:"require_email_verification" url:"require_email_verification,omitempty"` - RequireApplication bool `json:"require_application" url:"require_application,omitempty"` - ApplicationQuestion Optional[string] `json:"application_question" url:"application_question,omitempty"` - PrivateInstance bool `json:"private_instance" url:"private_instance,omitempty"` - ActorID string `json:"actor_id" url:"actor_id,omitempty"` - LastRefreshedAt LemmyTime `json:"last_refreshed_at" url:"last_refreshed_at,omitempty"` - InboxURL string `json:"inbox_url" url:"inbox_url,omitempty"` - PrivateKey Optional[string] `json:"private_key" url:"private_key,omitempty"` - PublicKey string `json:"public_key" url:"public_key,omitempty"` - DefaultTheme string `json:"default_theme" url:"default_theme,omitempty"` - DefaultPostListingType string `json:"default_post_listing_type" url:"default_post_listing_type,omitempty"` - LegalInformation Optional[string] `json:"legal_information" url:"legal_information,omitempty"` + ID int `json:"id" url:"id,omitempty"` + Name string `json:"name" url:"name,omitempty"` + Sidebar Optional[string] `json:"sidebar" url:"sidebar,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + Icon Optional[string] `json:"icon" url:"icon,omitempty"` + Banner Optional[string] `json:"banner" url:"banner,omitempty"` + Description Optional[string] `json:"description" url:"description,omitempty"` + ActorID string `json:"actor_id" url:"actor_id,omitempty"` + LastRefreshedAt LemmyTime `json:"last_refreshed_at" url:"last_refreshed_at,omitempty"` + InboxURL string `json:"inbox_url" url:"inbox_url,omitempty"` + PrivateKey Optional[string] `json:"private_key" url:"private_key,omitempty"` + PublicKey string `json:"public_key" url:"public_key,omitempty"` + InstanceID int `json:"instance_id" url:"instance_id,omitempty"` } -type SiteForm struct { - Name string `json:"name" url:"name,omitempty"` - Sidebar Optional[Optional[string]] `json:"sidebar" url:"sidebar,omitempty"` - Updated LemmyTime `json:"updated" url:"updated,omitempty"` - EnableDownvotes Optional[bool] `json:"enable_downvotes" url:"enable_downvotes,omitempty"` - OpenRegistration Optional[bool] `json:"open_registration" url:"open_registration,omitempty"` - EnableNSFW Optional[bool] `json:"enable_nsfw" url:"enable_nsfw,omitempty"` - Icon Optional[Optional[string]] `json:"icon" url:"icon,omitempty"` - Banner Optional[Optional[string]] `json:"banner" url:"banner,omitempty"` - Description Optional[Optional[string]] `json:"description" url:"description,omitempty"` - CommunityCreationAdminOnly Optional[bool] `json:"community_creation_admin_only" url:"community_creation_admin_only,omitempty"` - RequireEmailVerification Optional[bool] `json:"require_email_verification" url:"require_email_verification,omitempty"` - RequireApplication Optional[bool] `json:"require_application" url:"require_application,omitempty"` - ApplicationQuestion Optional[Optional[string]] `json:"application_question" url:"application_question,omitempty"` - PrivateInstance Optional[bool] `json:"private_instance" url:"private_instance,omitempty"` - ActorID Optional[string] `json:"actor_id" url:"actor_id,omitempty"` - LastRefreshedAt LemmyTime `json:"last_refreshed_at" url:"last_refreshed_at,omitempty"` - InboxURL Optional[string] `json:"inbox_url" url:"inbox_url,omitempty"` - PrivateKey Optional[Optional[string]] `json:"private_key" url:"private_key,omitempty"` - PublicKey Optional[string] `json:"public_key" url:"public_key,omitempty"` - DefaultTheme Optional[string] `json:"default_theme" url:"default_theme,omitempty"` - DefaultPostListingType Optional[string] `json:"default_post_listing_type" url:"default_post_listing_type,omitempty"` - LegalInformation Optional[string] `json:"legal_information" url:"legal_information,omitempty"` +type SiteInsertForm struct { + Name string `json:"name" url:"name,omitempty"` + Sidebar Optional[string] `json:"sidebar" url:"sidebar,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + Icon Optional[string] `json:"icon" url:"icon,omitempty"` + Banner Optional[string] `json:"banner" url:"banner,omitempty"` + Description Optional[string] `json:"description" url:"description,omitempty"` + ActorID Optional[string] `json:"actor_id" url:"actor_id,omitempty"` + LastRefreshedAt LemmyTime `json:"last_refreshed_at" url:"last_refreshed_at,omitempty"` + InboxURL Optional[string] `json:"inbox_url" url:"inbox_url,omitempty"` + PrivateKey Optional[string] `json:"private_key" url:"private_key,omitempty"` + PublicKey Optional[string] `json:"public_key" url:"public_key,omitempty"` + InstanceID int `json:"instance_id" url:"instance_id,omitempty"` +} +type SiteUpdateForm struct { + Name Optional[string] `json:"name" url:"name,omitempty"` + Sidebar Optional[Optional[string]] `json:"sidebar" url:"sidebar,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` + Icon Optional[Optional[string]] `json:"icon" url:"icon,omitempty"` + Banner Optional[Optional[string]] `json:"banner" url:"banner,omitempty"` + Description Optional[Optional[string]] `json:"description" url:"description,omitempty"` + ActorID Optional[string] `json:"actor_id" url:"actor_id,omitempty"` + LastRefreshedAt LemmyTime `json:"last_refreshed_at" url:"last_refreshed_at,omitempty"` + InboxURL Optional[string] `json:"inbox_url" url:"inbox_url,omitempty"` + PrivateKey Optional[Optional[string]] `json:"private_key" url:"private_key,omitempty"` + PublicKey Optional[string] `json:"public_key" url:"public_key,omitempty"` } diff --git a/types/site.gen.go b/types/site.gen.go index 1c025a7..bd4228d 100644 --- a/types/site.gen.go +++ b/types/site.gen.go @@ -35,16 +35,18 @@ type ResolveObjectResponse struct { LemmyResponse } type GetModlog struct { - ModPersonID Optional[int] `json:"mod_person_id" url:"mod_person_id,omitempty"` - CommunityID Optional[int] `json:"community_id" url:"community_id,omitempty"` - Page Optional[int64] `json:"page" url:"page,omitempty"` - Limit Optional[int64] `json:"limit" url:"limit,omitempty"` - Auth Optional[string] `json:"auth" url:"auth,omitempty"` + ModPersonID Optional[int] `json:"mod_person_id" url:"mod_person_id,omitempty"` + CommunityID Optional[int] `json:"community_id" url:"community_id,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + Auth Optional[string] `json:"auth" url:"auth,omitempty"` + Type Optional[ModlogActionType] `json:"type_" url:"type_,omitempty"` + OtherPersonID Optional[int] `json:"other_person_id" url:"other_person_id,omitempty"` } type GetModlogResponse struct { RemovedPosts []ModRemovePostView `json:"removed_posts" url:"removed_posts,omitempty"` LockedPosts []ModLockPostView `json:"locked_posts" url:"locked_posts,omitempty"` - StickiedPosts []ModStickyPostView `json:"stickied_posts" url:"stickied_posts,omitempty"` + FeaturedPosts []ModFeaturePostView `json:"featured_posts" url:"featured_posts,omitempty"` RemovedComments []ModRemoveCommentView `json:"removed_comments" url:"removed_comments,omitempty"` RemovedCommunities []ModRemoveCommunityView `json:"removed_communities" url:"removed_communities,omitempty"` BannedFromCommunity []ModBanFromCommunityView `json:"banned_from_community" url:"banned_from_community,omitempty"` @@ -52,45 +54,98 @@ type GetModlogResponse struct { AddedToCommunity []ModAddCommunityView `json:"added_to_community" url:"added_to_community,omitempty"` TransferredToCommunity []ModTransferCommunityView `json:"transferred_to_community" url:"transferred_to_community,omitempty"` Added []ModAddView `json:"added" url:"added,omitempty"` + AdminPurgedPersons []AdminPurgePersonView `json:"admin_purged_persons" url:"admin_purged_persons,omitempty"` + AdminPurgedCommunities []AdminPurgeCommunityView `json:"admin_purged_communities" url:"admin_purged_communities,omitempty"` + AdminPurgedPosts []AdminPurgePostView `json:"admin_purged_posts" url:"admin_purged_posts,omitempty"` + AdminPurgedComments []AdminPurgeCommentView `json:"admin_purged_comments" url:"admin_purged_comments,omitempty"` HiddenCommunities []ModHideCommunityView `json:"hidden_communities" url:"hidden_communities,omitempty"` LemmyResponse } type CreateSite struct { - Name string `json:"name" url:"name,omitempty"` - Sidebar Optional[string] `json:"sidebar" url:"sidebar,omitempty"` - Description Optional[string] `json:"description" url:"description,omitempty"` - Icon Optional[string] `json:"icon" url:"icon,omitempty"` - Banner Optional[string] `json:"banner" url:"banner,omitempty"` - EnableDownvotes Optional[bool] `json:"enable_downvotes" url:"enable_downvotes,omitempty"` - OpenRegistration Optional[bool] `json:"open_registration" url:"open_registration,omitempty"` - EnableNSFW Optional[bool] `json:"enable_nsfw" url:"enable_nsfw,omitempty"` - CommunityCreationAdminOnly Optional[bool] `json:"community_creation_admin_only" url:"community_creation_admin_only,omitempty"` - RequireEmailVerification Optional[bool] `json:"require_email_verification" url:"require_email_verification,omitempty"` - RequireApplication Optional[bool] `json:"require_application" url:"require_application,omitempty"` - ApplicationQuestion Optional[string] `json:"application_question" url:"application_question,omitempty"` - PrivateInstance Optional[bool] `json:"private_instance" url:"private_instance,omitempty"` - DefaultTheme Optional[string] `json:"default_theme" url:"default_theme,omitempty"` - DefaultPostListingType Optional[string] `json:"default_post_listing_type" url:"default_post_listing_type,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` + Name string `json:"name" url:"name,omitempty"` + Sidebar Optional[string] `json:"sidebar" url:"sidebar,omitempty"` + Description Optional[string] `json:"description" url:"description,omitempty"` + Icon Optional[string] `json:"icon" url:"icon,omitempty"` + Banner Optional[string] `json:"banner" url:"banner,omitempty"` + EnableDownvotes Optional[bool] `json:"enable_downvotes" url:"enable_downvotes,omitempty"` + EnableNSFW Optional[bool] `json:"enable_nsfw" url:"enable_nsfw,omitempty"` + CommunityCreationAdminOnly Optional[bool] `json:"community_creation_admin_only" url:"community_creation_admin_only,omitempty"` + RequireEmailVerification Optional[bool] `json:"require_email_verification" url:"require_email_verification,omitempty"` + ApplicationQuestion Optional[string] `json:"application_question" url:"application_question,omitempty"` + PrivateInstance Optional[bool] `json:"private_instance" url:"private_instance,omitempty"` + DefaultTheme Optional[string] `json:"default_theme" url:"default_theme,omitempty"` + DefaultPostListingType Optional[string] `json:"default_post_listing_type" url:"default_post_listing_type,omitempty"` + LegalInformation Optional[string] `json:"legal_information" url:"legal_information,omitempty"` + ApplicationEmailAdmins Optional[bool] `json:"application_email_admins" url:"application_email_admins,omitempty"` + HideModlogModNames Optional[bool] `json:"hide_modlog_mod_names" url:"hide_modlog_mod_names,omitempty"` + DiscussionLanguages Optional[[]int] `json:"discussion_languages" url:"discussion_languages,omitempty"` + SlurFilterRegex Optional[string] `json:"slur_filter_regex" url:"slur_filter_regex,omitempty"` + ActorNameMaxLength Optional[int32] `json:"actor_name_max_length" url:"actor_name_max_length,omitempty"` + RateLimitMessage Optional[int32] `json:"rate_limit_message" url:"rate_limit_message,omitempty"` + RateLimitMessagePerSecond Optional[int32] `json:"rate_limit_message_per_second" url:"rate_limit_message_per_second,omitempty"` + RateLimitPost Optional[int32] `json:"rate_limit_post" url:"rate_limit_post,omitempty"` + RateLimitPostPerSecond Optional[int32] `json:"rate_limit_post_per_second" url:"rate_limit_post_per_second,omitempty"` + RateLimitRegister Optional[int32] `json:"rate_limit_register" url:"rate_limit_register,omitempty"` + RateLimitRegisterPerSecond Optional[int32] `json:"rate_limit_register_per_second" url:"rate_limit_register_per_second,omitempty"` + RateLimitImage Optional[int32] `json:"rate_limit_image" url:"rate_limit_image,omitempty"` + RateLimitImagePerSecond Optional[int32] `json:"rate_limit_image_per_second" url:"rate_limit_image_per_second,omitempty"` + RateLimitComment Optional[int32] `json:"rate_limit_comment" url:"rate_limit_comment,omitempty"` + RateLimitCommentPerSecond Optional[int32] `json:"rate_limit_comment_per_second" url:"rate_limit_comment_per_second,omitempty"` + RateLimitSearch Optional[int32] `json:"rate_limit_search" url:"rate_limit_search,omitempty"` + RateLimitSearchPerSecond Optional[int32] `json:"rate_limit_search_per_second" url:"rate_limit_search_per_second,omitempty"` + FederationEnabled Optional[bool] `json:"federation_enabled" url:"federation_enabled,omitempty"` + FederationDebug Optional[bool] `json:"federation_debug" url:"federation_debug,omitempty"` + FederationWorkerCount Optional[int32] `json:"federation_worker_count" url:"federation_worker_count,omitempty"` + CaptchaEnabled Optional[bool] `json:"captcha_enabled" url:"captcha_enabled,omitempty"` + CaptchaDifficulty Optional[string] `json:"captcha_difficulty" url:"captcha_difficulty,omitempty"` + AllowedInstances Optional[[]string] `json:"allowed_instances" url:"allowed_instances,omitempty"` + BlockedInstances Optional[[]string] `json:"blocked_instances" url:"blocked_instances,omitempty"` + Taglines Optional[[]string] `json:"taglines" url:"taglines,omitempty"` + RegistrationMode Optional[RegistrationMode] `json:"registration_mode" url:"registration_mode,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` } type EditSite struct { - Name Optional[string] `json:"name" url:"name,omitempty"` - Sidebar Optional[string] `json:"sidebar" url:"sidebar,omitempty"` - Description Optional[string] `json:"description" url:"description,omitempty"` - Icon Optional[string] `json:"icon" url:"icon,omitempty"` - Banner Optional[string] `json:"banner" url:"banner,omitempty"` - EnableDownvotes Optional[bool] `json:"enable_downvotes" url:"enable_downvotes,omitempty"` - OpenRegistration Optional[bool] `json:"open_registration" url:"open_registration,omitempty"` - EnableNSFW Optional[bool] `json:"enable_nsfw" url:"enable_nsfw,omitempty"` - CommunityCreationAdminOnly Optional[bool] `json:"community_creation_admin_only" url:"community_creation_admin_only,omitempty"` - RequireEmailVerification Optional[bool] `json:"require_email_verification" url:"require_email_verification,omitempty"` - RequireApplication Optional[bool] `json:"require_application" url:"require_application,omitempty"` - ApplicationQuestion Optional[string] `json:"application_question" url:"application_question,omitempty"` - PrivateInstance Optional[bool] `json:"private_instance" url:"private_instance,omitempty"` - DefaultTheme Optional[string] `json:"default_theme" url:"default_theme,omitempty"` - DefaultPostListingType Optional[string] `json:"default_post_listing_type" url:"default_post_listing_type,omitempty"` - LegalInformation Optional[string] `json:"legal_information" url:"legal_information,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` + Name Optional[string] `json:"name" url:"name,omitempty"` + Sidebar Optional[string] `json:"sidebar" url:"sidebar,omitempty"` + Description Optional[string] `json:"description" url:"description,omitempty"` + Icon Optional[string] `json:"icon" url:"icon,omitempty"` + Banner Optional[string] `json:"banner" url:"banner,omitempty"` + EnableDownvotes Optional[bool] `json:"enable_downvotes" url:"enable_downvotes,omitempty"` + EnableNSFW Optional[bool] `json:"enable_nsfw" url:"enable_nsfw,omitempty"` + CommunityCreationAdminOnly Optional[bool] `json:"community_creation_admin_only" url:"community_creation_admin_only,omitempty"` + RequireEmailVerification Optional[bool] `json:"require_email_verification" url:"require_email_verification,omitempty"` + ApplicationQuestion Optional[string] `json:"application_question" url:"application_question,omitempty"` + PrivateInstance Optional[bool] `json:"private_instance" url:"private_instance,omitempty"` + DefaultTheme Optional[string] `json:"default_theme" url:"default_theme,omitempty"` + DefaultPostListingType Optional[string] `json:"default_post_listing_type" url:"default_post_listing_type,omitempty"` + LegalInformation Optional[string] `json:"legal_information" url:"legal_information,omitempty"` + ApplicationEmailAdmins Optional[bool] `json:"application_email_admins" url:"application_email_admins,omitempty"` + HideModlogModNames Optional[bool] `json:"hide_modlog_mod_names" url:"hide_modlog_mod_names,omitempty"` + DiscussionLanguages Optional[[]int] `json:"discussion_languages" url:"discussion_languages,omitempty"` + SlurFilterRegex Optional[string] `json:"slur_filter_regex" url:"slur_filter_regex,omitempty"` + ActorNameMaxLength Optional[int32] `json:"actor_name_max_length" url:"actor_name_max_length,omitempty"` + RateLimitMessage Optional[int32] `json:"rate_limit_message" url:"rate_limit_message,omitempty"` + RateLimitMessagePerSecond Optional[int32] `json:"rate_limit_message_per_second" url:"rate_limit_message_per_second,omitempty"` + RateLimitPost Optional[int32] `json:"rate_limit_post" url:"rate_limit_post,omitempty"` + RateLimitPostPerSecond Optional[int32] `json:"rate_limit_post_per_second" url:"rate_limit_post_per_second,omitempty"` + RateLimitRegister Optional[int32] `json:"rate_limit_register" url:"rate_limit_register,omitempty"` + RateLimitRegisterPerSecond Optional[int32] `json:"rate_limit_register_per_second" url:"rate_limit_register_per_second,omitempty"` + RateLimitImage Optional[int32] `json:"rate_limit_image" url:"rate_limit_image,omitempty"` + RateLimitImagePerSecond Optional[int32] `json:"rate_limit_image_per_second" url:"rate_limit_image_per_second,omitempty"` + RateLimitComment Optional[int32] `json:"rate_limit_comment" url:"rate_limit_comment,omitempty"` + RateLimitCommentPerSecond Optional[int32] `json:"rate_limit_comment_per_second" url:"rate_limit_comment_per_second,omitempty"` + RateLimitSearch Optional[int32] `json:"rate_limit_search" url:"rate_limit_search,omitempty"` + RateLimitSearchPerSecond Optional[int32] `json:"rate_limit_search_per_second" url:"rate_limit_search_per_second,omitempty"` + FederationEnabled Optional[bool] `json:"federation_enabled" url:"federation_enabled,omitempty"` + FederationDebug Optional[bool] `json:"federation_debug" url:"federation_debug,omitempty"` + FederationWorkerCount Optional[int32] `json:"federation_worker_count" url:"federation_worker_count,omitempty"` + CaptchaEnabled Optional[bool] `json:"captcha_enabled" url:"captcha_enabled,omitempty"` + CaptchaDifficulty Optional[string] `json:"captcha_difficulty" url:"captcha_difficulty,omitempty"` + AllowedInstances Optional[[]string] `json:"allowed_instances" url:"allowed_instances,omitempty"` + BlockedInstances Optional[[]string] `json:"blocked_instances" url:"blocked_instances,omitempty"` + Taglines Optional[[]string] `json:"taglines" url:"taglines,omitempty"` + RegistrationMode Optional[RegistrationMode] `json:"registration_mode" url:"registration_mode,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` } type GetSite struct { Auth Optional[string] `json:"auth" url:"auth,omitempty"` @@ -100,40 +155,57 @@ type SiteResponse struct { LemmyResponse } type GetSiteResponse struct { - SiteView Optional[SiteView] `json:"site_view" url:"site_view,omitempty"` - Admins []PersonViewSafe `json:"admins" url:"admins,omitempty"` - Online uint `json:"online" url:"online,omitempty"` - Version string `json:"version" url:"version,omitempty"` - MyUser Optional[MyUserInfo] `json:"my_user" url:"my_user,omitempty"` - FederatedInstances Optional[FederatedInstances] `json:"federated_instances" url:"federated_instances,omitempty"` + SiteView SiteView `json:"site_view" url:"site_view,omitempty"` + Admins []PersonViewSafe `json:"admins" url:"admins,omitempty"` + Online uint `json:"online" url:"online,omitempty"` + Version string `json:"version" url:"version,omitempty"` + MyUser Optional[MyUserInfo] `json:"my_user" url:"my_user,omitempty"` + FederatedInstances Optional[FederatedInstances] `json:"federated_instances" url:"federated_instances,omitempty"` + AllLanguages []Language `json:"all_languages" url:"all_languages,omitempty"` + DiscussionLanguages []int `json:"discussion_languages" url:"discussion_languages,omitempty"` + Taglines Optional[[]Tagline] `json:"taglines" url:"taglines,omitempty"` LemmyResponse } type MyUserInfo struct { - LocalUserView LocalUserSettingsView `json:"local_user_view" url:"local_user_view,omitempty"` - Follows []CommunityFollowerView `json:"follows" url:"follows,omitempty"` - Moderates []CommunityModeratorView `json:"moderates" url:"moderates,omitempty"` - CommunityBlocks []CommunityBlockView `json:"community_blocks" url:"community_blocks,omitempty"` - PersonBlocks []PersonBlockView `json:"person_blocks" url:"person_blocks,omitempty"` + LocalUserView LocalUserSettingsView `json:"local_user_view" url:"local_user_view,omitempty"` + Follows []CommunityFollowerView `json:"follows" url:"follows,omitempty"` + Moderates []CommunityModeratorView `json:"moderates" url:"moderates,omitempty"` + CommunityBlocks []CommunityBlockView `json:"community_blocks" url:"community_blocks,omitempty"` + PersonBlocks []PersonBlockView `json:"person_blocks" url:"person_blocks,omitempty"` + DiscussionLanguages []int `json:"discussion_languages" url:"discussion_languages,omitempty"` } type LeaveAdmin struct { Auth string `json:"auth" url:"auth,omitempty"` } -type GetSiteConfig struct { - Auth string `json:"auth" url:"auth,omitempty"` -} -type GetSiteConfigResponse struct { - ConfigHjson string `json:"config_hjson" url:"config_hjson,omitempty"` - LemmyResponse -} -type SaveSiteConfig struct { - ConfigHjson string `json:"config_hjson" url:"config_hjson,omitempty"` - Auth string `json:"auth" url:"auth,omitempty"` -} type FederatedInstances struct { Linked []string `json:"linked" url:"linked,omitempty"` Allowed Optional[[]string] `json:"allowed" url:"allowed,omitempty"` Blocked Optional[[]string] `json:"blocked" url:"blocked,omitempty"` } +type PurgePerson struct { + PersonID int `json:"person_id" url:"person_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` +} +type PurgeCommunity struct { + CommunityID int `json:"community_id" url:"community_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` +} +type PurgePost struct { + PostID int `json:"post_id" url:"post_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` +} +type PurgeComment struct { + CommentID int `json:"comment_id" url:"comment_id,omitempty"` + Reason Optional[string] `json:"reason" url:"reason,omitempty"` + Auth string `json:"auth" url:"auth,omitempty"` +} +type PurgeItemResponse struct { + Success bool `json:"success" url:"success,omitempty"` + LemmyResponse +} type ListRegistrationApplications struct { UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"` Page Optional[int64] `json:"page" url:"page,omitempty"` diff --git a/types/structs.1.gen.go b/types/structs.1.gen.go index 2456aa8..aa988ca 100644 --- a/types/structs.1.gen.go +++ b/types/structs.1.gen.go @@ -1,78 +1,63 @@ -// Source: lemmy/crates/db_views/src/structs.rs +// Source: lemmy/crates/db_views_actor/src/structs.rs // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. package types -type CommentReportView struct { - CommentReport CommentReport `json:"comment_report" url:"comment_report,omitempty"` - Comment Comment `json:"comment" url:"comment,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` - Creator PersonSafe `json:"creator" url:"creator,omitempty"` - CommentCreator PersonSafeAlias1 `json:"comment_creator" url:"comment_creator,omitempty"` - Counts CommentAggregates `json:"counts" url:"counts,omitempty"` - CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` - MyVote Optional[int16] `json:"my_vote" url:"my_vote,omitempty"` - Resolver Optional[PersonSafeAlias2] `json:"resolver" url:"resolver,omitempty"` +type CommunityBlockView struct { + Person PersonSafe `json:"person" url:"person,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` } -type CommentView struct { - Comment Comment `json:"comment" url:"comment,omitempty"` - Creator PersonSafe `json:"creator" url:"creator,omitempty"` - Recipient Optional[PersonSafeAlias1] `json:"recipient" url:"recipient,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` - Counts CommentAggregates `json:"counts" url:"counts,omitempty"` - CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` - Subscribed bool `json:"subscribed" url:"subscribed,omitempty"` - Saved bool `json:"saved" url:"saved,omitempty"` - CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` - MyVote Optional[int16] `json:"my_vote" url:"my_vote,omitempty"` +type CommunityFollowerView struct { + Community CommunitySafe `json:"community" url:"community,omitempty"` + Follower PersonSafe `json:"follower" url:"follower,omitempty"` } -type LocalUserView struct { - LocalUser LocalUser `json:"local_user" url:"local_user,omitempty"` - Person Person `json:"person" url:"person,omitempty"` - Counts PersonAggregates `json:"counts" url:"counts,omitempty"` +type CommunityModeratorView struct { + Community CommunitySafe `json:"community" url:"community,omitempty"` + Moderator PersonSafe `json:"moderator" url:"moderator,omitempty"` } -type LocalUserSettingsView struct { - LocalUser LocalUserSettings `json:"local_user" url:"local_user,omitempty"` - Person PersonSafe `json:"person" url:"person,omitempty"` - Counts PersonAggregates `json:"counts" url:"counts,omitempty"` +type CommunityPersonBanView struct { + Community CommunitySafe `json:"community" url:"community,omitempty"` + Person PersonSafe `json:"person" url:"person,omitempty"` } -type PostReportView struct { - PostReport PostReport `json:"post_report" url:"post_report,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` - Creator PersonSafe `json:"creator" url:"creator,omitempty"` - PostCreator PersonSafeAlias1 `json:"post_creator" url:"post_creator,omitempty"` - CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` - MyVote Optional[int16] `json:"my_vote" url:"my_vote,omitempty"` - Counts PostAggregates `json:"counts" url:"counts,omitempty"` - Resolver Optional[PersonSafeAlias2] `json:"resolver" url:"resolver,omitempty"` +type CommunityView struct { + Community CommunitySafe `json:"community" url:"community,omitempty"` + Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` + Blocked bool `json:"blocked" url:"blocked,omitempty"` + Counts CommunityAggregates `json:"counts" url:"counts,omitempty"` } -type PostView struct { - Post Post `json:"post" url:"post,omitempty"` - Creator PersonSafe `json:"creator" url:"creator,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` - CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` - Counts PostAggregates `json:"counts" url:"counts,omitempty"` - Subscribed bool `json:"subscribed" url:"subscribed,omitempty"` - Saved bool `json:"saved" url:"saved,omitempty"` - Read bool `json:"read" url:"read,omitempty"` - CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` - MyVote Optional[int16] `json:"my_vote" url:"my_vote,omitempty"` +type PersonBlockView struct { + Person PersonSafe `json:"person" url:"person,omitempty"` + Target PersonSafe `json:"target" url:"target,omitempty"` } -type PrivateMessageView struct { - PrivateMessage PrivateMessage `json:"private_message" url:"private_message,omitempty"` - Creator PersonSafe `json:"creator" url:"creator,omitempty"` - Recipient PersonSafeAlias1 `json:"recipient" url:"recipient,omitempty"` +type PersonMentionView struct { + PersonMention PersonMention `json:"person_mention" url:"person_mention,omitempty"` + Comment Comment `json:"comment" url:"comment,omitempty"` + Creator PersonSafe `json:"creator" url:"creator,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` + Recipient PersonSafe `json:"recipient" url:"recipient,omitempty"` + Counts CommentAggregates `json:"counts" url:"counts,omitempty"` + CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` + Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` + Saved bool `json:"saved" url:"saved,omitempty"` + CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` + MyVote Optional[int16] `json:"my_vote" url:"my_vote,omitempty"` } -type RegistrationApplicationView struct { - RegistrationApplication RegistrationApplication `json:"registration_application" url:"registration_application,omitempty"` - CreatorLocalUser LocalUserSettings `json:"creator_local_user" url:"creator_local_user,omitempty"` - Creator PersonSafe `json:"creator" url:"creator,omitempty"` - Admin Optional[PersonSafeAlias1] `json:"admin" url:"admin,omitempty"` +type CommentReplyView struct { + CommentReply CommentReply `json:"comment_reply" url:"comment_reply,omitempty"` + Comment Comment `json:"comment" url:"comment,omitempty"` + Creator PersonSafe `json:"creator" url:"creator,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` + Recipient PersonSafe `json:"recipient" url:"recipient,omitempty"` + Counts CommentAggregates `json:"counts" url:"counts,omitempty"` + CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` + Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` + Saved bool `json:"saved" url:"saved,omitempty"` + CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` + MyVote Optional[int16] `json:"my_vote" url:"my_vote,omitempty"` } -type SiteView struct { - Site Site `json:"site" url:"site,omitempty"` - Counts SiteAggregates `json:"counts" url:"counts,omitempty"` +type PersonViewSafe struct { + Person PersonSafe `json:"person" url:"person,omitempty"` + Counts PersonAggregates `json:"counts" url:"counts,omitempty"` } diff --git a/types/structs.2.gen.go b/types/structs.2.gen.go index 9f96b99..01c0790 100644 --- a/types/structs.2.gen.go +++ b/types/structs.2.gen.go @@ -1,69 +1,87 @@ -// Source: lemmy/crates/db_views_moderator/src/structs.rs +// Source: lemmy/crates/db_views/src/structs.rs // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. package types -type ModAddCommunityView struct { - ModAddCommunity ModAddCommunity `json:"mod_add_community" url:"mod_add_community,omitempty"` - Moderator PersonSafe `json:"moderator" url:"moderator,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` - ModdedPerson PersonSafeAlias1 `json:"modded_person" url:"modded_person,omitempty"` +type CommentReportView struct { + CommentReport CommentReport `json:"comment_report" url:"comment_report,omitempty"` + Comment Comment `json:"comment" url:"comment,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` + Creator PersonSafe `json:"creator" url:"creator,omitempty"` + CommentCreator PersonSafe `json:"comment_creator" url:"comment_creator,omitempty"` + Counts CommentAggregates `json:"counts" url:"counts,omitempty"` + CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` + MyVote Optional[int16] `json:"my_vote" url:"my_vote,omitempty"` + Resolver Optional[PersonSafe] `json:"resolver" url:"resolver,omitempty"` } -type ModAddView struct { - ModAdd ModAdd `json:"mod_add" url:"mod_add,omitempty"` - Moderator PersonSafe `json:"moderator" url:"moderator,omitempty"` - ModdedPerson PersonSafeAlias1 `json:"modded_person" url:"modded_person,omitempty"` +type CommentView struct { + Comment Comment `json:"comment" url:"comment,omitempty"` + Creator PersonSafe `json:"creator" url:"creator,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` + Counts CommentAggregates `json:"counts" url:"counts,omitempty"` + CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` + Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` + Saved bool `json:"saved" url:"saved,omitempty"` + CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` + MyVote Optional[int16] `json:"my_vote" url:"my_vote,omitempty"` } -type ModBanFromCommunityView struct { - ModBanFromCommunity ModBanFromCommunity `json:"mod_ban_from_community" url:"mod_ban_from_community,omitempty"` - Moderator PersonSafe `json:"moderator" url:"moderator,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` - BannedPerson PersonSafeAlias1 `json:"banned_person" url:"banned_person,omitempty"` +type LocalUserView struct { + LocalUser LocalUser `json:"local_user" url:"local_user,omitempty"` + Person Person `json:"person" url:"person,omitempty"` + Counts PersonAggregates `json:"counts" url:"counts,omitempty"` } -type ModBanView struct { - ModBan ModBan `json:"mod_ban" url:"mod_ban,omitempty"` - Moderator PersonSafe `json:"moderator" url:"moderator,omitempty"` - BannedPerson PersonSafeAlias1 `json:"banned_person" url:"banned_person,omitempty"` +type LocalUserSettingsView struct { + LocalUser LocalUserSettings `json:"local_user" url:"local_user,omitempty"` + Person PersonSafe `json:"person" url:"person,omitempty"` + Counts PersonAggregates `json:"counts" url:"counts,omitempty"` } -type ModHideCommunityView struct { - ModHideCommunity ModHideCommunity `json:"mod_hide_community" url:"mod_hide_community,omitempty"` - Admin PersonSafe `json:"admin" url:"admin,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` +type PostReportView struct { + PostReport PostReport `json:"post_report" url:"post_report,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` + Creator PersonSafe `json:"creator" url:"creator,omitempty"` + PostCreator PersonSafe `json:"post_creator" url:"post_creator,omitempty"` + CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` + MyVote Optional[int16] `json:"my_vote" url:"my_vote,omitempty"` + Counts PostAggregates `json:"counts" url:"counts,omitempty"` + Resolver Optional[PersonSafe] `json:"resolver" url:"resolver,omitempty"` } -type ModLockPostView struct { - ModLockPost ModLockPost `json:"mod_lock_post" url:"mod_lock_post,omitempty"` - Moderator PersonSafe `json:"moderator" url:"moderator,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` +type PostView struct { + Post Post `json:"post" url:"post,omitempty"` + Creator PersonSafe `json:"creator" url:"creator,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` + CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` + Counts PostAggregates `json:"counts" url:"counts,omitempty"` + Subscribed SubscribedType `json:"subscribed" url:"subscribed,omitempty"` + Saved bool `json:"saved" url:"saved,omitempty"` + Read bool `json:"read" url:"read,omitempty"` + CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` + MyVote Optional[int16] `json:"my_vote" url:"my_vote,omitempty"` + UnreadComments int64 `json:"unread_comments" url:"unread_comments,omitempty"` } -type ModRemoveCommentView struct { - ModRemoveComment ModRemoveComment `json:"mod_remove_comment" url:"mod_remove_comment,omitempty"` - Moderator PersonSafe `json:"moderator" url:"moderator,omitempty"` - Comment Comment `json:"comment" url:"comment,omitempty"` - Commenter PersonSafeAlias1 `json:"commenter" url:"commenter,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` +type PrivateMessageView struct { + PrivateMessage PrivateMessage `json:"private_message" url:"private_message,omitempty"` + Creator PersonSafe `json:"creator" url:"creator,omitempty"` + Recipient PersonSafe `json:"recipient" url:"recipient,omitempty"` } -type ModRemoveCommunityView struct { - ModRemoveCommunity ModRemoveCommunity `json:"mod_remove_community" url:"mod_remove_community,omitempty"` - Moderator PersonSafe `json:"moderator" url:"moderator,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` +type PrivateMessageReportView struct { + PrivateMessageReport PrivateMessageReport `json:"private_message_report" url:"private_message_report,omitempty"` + PrivateMessage PrivateMessage `json:"private_message" url:"private_message,omitempty"` + PrivateMessageCreator PersonSafe `json:"private_message_creator" url:"private_message_creator,omitempty"` + Creator PersonSafe `json:"creator" url:"creator,omitempty"` + Resolver Optional[PersonSafe] `json:"resolver" url:"resolver,omitempty"` } -type ModRemovePostView struct { - ModRemovePost ModRemovePost `json:"mod_remove_post" url:"mod_remove_post,omitempty"` - Moderator PersonSafe `json:"moderator" url:"moderator,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` +type RegistrationApplicationView struct { + RegistrationApplication RegistrationApplication `json:"registration_application" url:"registration_application,omitempty"` + CreatorLocalUser LocalUserSettings `json:"creator_local_user" url:"creator_local_user,omitempty"` + Creator PersonSafe `json:"creator" url:"creator,omitempty"` + Admin Optional[PersonSafe] `json:"admin" url:"admin,omitempty"` } -type ModStickyPostView struct { - ModStickyPost ModStickyPost `json:"mod_sticky_post" url:"mod_sticky_post,omitempty"` - Moderator PersonSafe `json:"moderator" url:"moderator,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` -} -type ModTransferCommunityView struct { - ModTransferCommunity ModTransferCommunity `json:"mod_transfer_community" url:"mod_transfer_community,omitempty"` - Moderator PersonSafe `json:"moderator" url:"moderator,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` - ModdedPerson PersonSafeAlias1 `json:"modded_person" url:"modded_person,omitempty"` +type SiteView struct { + Site Site `json:"site" url:"site,omitempty"` + LocalSite LocalSite `json:"local_site" url:"local_site,omitempty"` + LocalSiteRateLimit LocalSiteRateLimit `json:"local_site_rate_limit" url:"local_site_rate_limit,omitempty"` + Counts SiteAggregates `json:"counts" url:"counts,omitempty"` } diff --git a/types/structs.3.gen.go b/types/structs.3.gen.go index bb387d4..03f20a8 100644 --- a/types/structs.3.gen.go +++ b/types/structs.3.gen.go @@ -1,57 +1,95 @@ -// Source: lemmy/crates/db_schema/src/aggregates/structs.rs +// Source: lemmy/crates/db_views_moderator/src/structs.rs // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. package types -type CommentAggregates struct { - ID int32 `json:"id" url:"id,omitempty"` - CommentID int `json:"comment_id" url:"comment_id,omitempty"` - Score int64 `json:"score" url:"score,omitempty"` - Upvotes int64 `json:"upvotes" url:"upvotes,omitempty"` - Downvotes int64 `json:"downvotes" url:"downvotes,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` +type ModAddCommunityView struct { + ModAddCommunity ModAddCommunity `json:"mod_add_community" url:"mod_add_community,omitempty"` + Moderator Optional[PersonSafe] `json:"moderator" url:"moderator,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` + ModdedPerson PersonSafe `json:"modded_person" url:"modded_person,omitempty"` } -type CommunityAggregates struct { - ID int32 `json:"id" url:"id,omitempty"` - CommunityID int `json:"community_id" url:"community_id,omitempty"` - Subscribers int64 `json:"subscribers" url:"subscribers,omitempty"` - Posts int64 `json:"posts" url:"posts,omitempty"` - Comments int64 `json:"comments" url:"comments,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - UsersActiveDay int64 `json:"users_active_day" url:"users_active_day,omitempty"` - UsersActiveWeek int64 `json:"users_active_week" url:"users_active_week,omitempty"` - UsersActiveMonth int64 `json:"users_active_month" url:"users_active_month,omitempty"` - UsersActiveHalfYear int64 `json:"users_active_half_year" url:"users_active_half_year,omitempty"` +type ModAddView struct { + ModAdd ModAdd `json:"mod_add" url:"mod_add,omitempty"` + Moderator Optional[PersonSafe] `json:"moderator" url:"moderator,omitempty"` + ModdedPerson PersonSafe `json:"modded_person" url:"modded_person,omitempty"` } -type PersonAggregates struct { - ID int32 `json:"id" url:"id,omitempty"` - PersonID int `json:"person_id" url:"person_id,omitempty"` - PostCount int64 `json:"post_count" url:"post_count,omitempty"` - PostScore int64 `json:"post_score" url:"post_score,omitempty"` - CommentCount int64 `json:"comment_count" url:"comment_count,omitempty"` - CommentScore int64 `json:"comment_score" url:"comment_score,omitempty"` +type ModBanFromCommunityView struct { + ModBanFromCommunity ModBanFromCommunity `json:"mod_ban_from_community" url:"mod_ban_from_community,omitempty"` + Moderator Optional[PersonSafe] `json:"moderator" url:"moderator,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` + BannedPerson PersonSafe `json:"banned_person" url:"banned_person,omitempty"` } -type PostAggregates struct { - ID int32 `json:"id" url:"id,omitempty"` - PostID int `json:"post_id" url:"post_id,omitempty"` - Comments int64 `json:"comments" url:"comments,omitempty"` - Score int64 `json:"score" url:"score,omitempty"` - Upvotes int64 `json:"upvotes" url:"upvotes,omitempty"` - Downvotes int64 `json:"downvotes" url:"downvotes,omitempty"` - Stickied bool `json:"stickied" url:"stickied,omitempty"` - Published LemmyTime `json:"published" url:"published,omitempty"` - NewestCommentTimeNecro LemmyTime `json:"newest_comment_time_necro" url:"newest_comment_time_necro,omitempty"` - NewestCommentTime LemmyTime `json:"newest_comment_time" url:"newest_comment_time,omitempty"` +type ModBanView struct { + ModBan ModBan `json:"mod_ban" url:"mod_ban,omitempty"` + Moderator Optional[PersonSafe] `json:"moderator" url:"moderator,omitempty"` + BannedPerson PersonSafe `json:"banned_person" url:"banned_person,omitempty"` } -type SiteAggregates struct { - ID int32 `json:"id" url:"id,omitempty"` - SiteID int32 `json:"site_id" url:"site_id,omitempty"` - Users int64 `json:"users" url:"users,omitempty"` - Posts int64 `json:"posts" url:"posts,omitempty"` - Comments int64 `json:"comments" url:"comments,omitempty"` - Communities int64 `json:"communities" url:"communities,omitempty"` - UsersActiveDay int64 `json:"users_active_day" url:"users_active_day,omitempty"` - UsersActiveWeek int64 `json:"users_active_week" url:"users_active_week,omitempty"` - UsersActiveMonth int64 `json:"users_active_month" url:"users_active_month,omitempty"` - UsersActiveHalfYear int64 `json:"users_active_half_year" url:"users_active_half_year,omitempty"` +type ModHideCommunityView struct { + ModHideCommunity ModHideCommunity `json:"mod_hide_community" url:"mod_hide_community,omitempty"` + Admin Optional[PersonSafe] `json:"admin" url:"admin,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` +} +type ModLockPostView struct { + ModLockPost ModLockPost `json:"mod_lock_post" url:"mod_lock_post,omitempty"` + Moderator Optional[PersonSafe] `json:"moderator" url:"moderator,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` +} +type ModRemoveCommentView struct { + ModRemoveComment ModRemoveComment `json:"mod_remove_comment" url:"mod_remove_comment,omitempty"` + Moderator Optional[PersonSafe] `json:"moderator" url:"moderator,omitempty"` + Comment Comment `json:"comment" url:"comment,omitempty"` + Commenter PersonSafe `json:"commenter" url:"commenter,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` +} +type ModRemoveCommunityView struct { + ModRemoveCommunity ModRemoveCommunity `json:"mod_remove_community" url:"mod_remove_community,omitempty"` + Moderator Optional[PersonSafe] `json:"moderator" url:"moderator,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` +} +type ModRemovePostView struct { + ModRemovePost ModRemovePost `json:"mod_remove_post" url:"mod_remove_post,omitempty"` + Moderator Optional[PersonSafe] `json:"moderator" url:"moderator,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` +} +type ModFeaturePostView struct { + ModFeaturePost ModFeaturePost `json:"mod_feature_post" url:"mod_feature_post,omitempty"` + Moderator Optional[PersonSafe] `json:"moderator" url:"moderator,omitempty"` + Post Post `json:"post" url:"post,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` +} +type ModTransferCommunityView struct { + ModTransferCommunity ModTransferCommunity `json:"mod_transfer_community" url:"mod_transfer_community,omitempty"` + Moderator Optional[PersonSafe] `json:"moderator" url:"moderator,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` + ModdedPerson PersonSafe `json:"modded_person" url:"modded_person,omitempty"` +} +type AdminPurgeCommentView struct { + AdminPurgeComment AdminPurgeComment `json:"admin_purge_comment" url:"admin_purge_comment,omitempty"` + Admin Optional[PersonSafe] `json:"admin" url:"admin,omitempty"` + Post Post `json:"post" url:"post,omitempty"` +} +type AdminPurgeCommunityView struct { + AdminPurgeCommunity AdminPurgeCommunity `json:"admin_purge_community" url:"admin_purge_community,omitempty"` + Admin Optional[PersonSafe] `json:"admin" url:"admin,omitempty"` +} +type AdminPurgePersonView struct { + AdminPurgePerson AdminPurgePerson `json:"admin_purge_person" url:"admin_purge_person,omitempty"` + Admin Optional[PersonSafe] `json:"admin" url:"admin,omitempty"` +} +type AdminPurgePostView struct { + AdminPurgePost AdminPurgePost `json:"admin_purge_post" url:"admin_purge_post,omitempty"` + Admin Optional[PersonSafe] `json:"admin" url:"admin,omitempty"` + Community CommunitySafe `json:"community" url:"community,omitempty"` +} +type ModlogListParams struct { + CommunityID Optional[int] `json:"community_id" url:"community_id,omitempty"` + ModPersonID Optional[int] `json:"mod_person_id" url:"mod_person_id,omitempty"` + OtherPersonID Optional[int] `json:"other_person_id" url:"other_person_id,omitempty"` + Page Optional[int64] `json:"page" url:"page,omitempty"` + Limit Optional[int64] `json:"limit" url:"limit,omitempty"` + HideModlogNames bool `json:"hide_modlog_names" url:"hide_modlog_names,omitempty"` } diff --git a/types/structs.4.gen.go b/types/structs.4.gen.go new file mode 100644 index 0000000..e440153 --- /dev/null +++ b/types/structs.4.gen.go @@ -0,0 +1,72 @@ +// Source: lemmy/crates/db_schema/src/aggregates/structs.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types + +type CommentAggregates struct { + ID int32 `json:"id" url:"id,omitempty"` + CommentID int `json:"comment_id" url:"comment_id,omitempty"` + Score int64 `json:"score" url:"score,omitempty"` + Upvotes int64 `json:"upvotes" url:"upvotes,omitempty"` + Downvotes int64 `json:"downvotes" url:"downvotes,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + ChildCount int32 `json:"child_count" url:"child_count,omitempty"` +} +type CommunityAggregates struct { + ID int32 `json:"id" url:"id,omitempty"` + CommunityID int `json:"community_id" url:"community_id,omitempty"` + Subscribers int64 `json:"subscribers" url:"subscribers,omitempty"` + Posts int64 `json:"posts" url:"posts,omitempty"` + Comments int64 `json:"comments" url:"comments,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + UsersActiveDay int64 `json:"users_active_day" url:"users_active_day,omitempty"` + UsersActiveWeek int64 `json:"users_active_week" url:"users_active_week,omitempty"` + UsersActiveMonth int64 `json:"users_active_month" url:"users_active_month,omitempty"` + UsersActiveHalfYear int64 `json:"users_active_half_year" url:"users_active_half_year,omitempty"` +} +type PersonAggregates struct { + ID int32 `json:"id" url:"id,omitempty"` + PersonID int `json:"person_id" url:"person_id,omitempty"` + PostCount int64 `json:"post_count" url:"post_count,omitempty"` + PostScore int64 `json:"post_score" url:"post_score,omitempty"` + CommentCount int64 `json:"comment_count" url:"comment_count,omitempty"` + CommentScore int64 `json:"comment_score" url:"comment_score,omitempty"` +} +type PostAggregates struct { + ID int32 `json:"id" url:"id,omitempty"` + PostID int `json:"post_id" url:"post_id,omitempty"` + Comments int64 `json:"comments" url:"comments,omitempty"` + Score int64 `json:"score" url:"score,omitempty"` + Upvotes int64 `json:"upvotes" url:"upvotes,omitempty"` + Downvotes int64 `json:"downvotes" url:"downvotes,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + NewestCommentTimeNecro LemmyTime `json:"newest_comment_time_necro" url:"newest_comment_time_necro,omitempty"` + NewestCommentTime LemmyTime `json:"newest_comment_time" url:"newest_comment_time,omitempty"` + FeaturedCommunity bool `json:"featured_community" url:"featured_community,omitempty"` + FeaturedLocal bool `json:"featured_local" url:"featured_local,omitempty"` +} +type PersonPostAggregates struct { + ID int32 `json:"id" url:"id,omitempty"` + PersonID int `json:"person_id" url:"person_id,omitempty"` + PostID int `json:"post_id" url:"post_id,omitempty"` + ReadComments int64 `json:"read_comments" url:"read_comments,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` +} +type PersonPostAggregatesForm struct { + PersonID int `json:"person_id" url:"person_id,omitempty"` + PostID int `json:"post_id" url:"post_id,omitempty"` + ReadComments int64 `json:"read_comments" url:"read_comments,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` +} +type SiteAggregates struct { + ID int32 `json:"id" url:"id,omitempty"` + SiteID int `json:"site_id" url:"site_id,omitempty"` + Users int64 `json:"users" url:"users,omitempty"` + Posts int64 `json:"posts" url:"posts,omitempty"` + Comments int64 `json:"comments" url:"comments,omitempty"` + Communities int64 `json:"communities" url:"communities,omitempty"` + UsersActiveDay int64 `json:"users_active_day" url:"users_active_day,omitempty"` + UsersActiveWeek int64 `json:"users_active_week" url:"users_active_week,omitempty"` + UsersActiveMonth int64 `json:"users_active_month" url:"users_active_month,omitempty"` + UsersActiveHalfYear int64 `json:"users_active_half_year" url:"users_active_half_year,omitempty"` +} diff --git a/types/structs.gen.go b/types/structs.gen.go index c4da5fe..17db589 100644 --- a/types/structs.gen.go +++ b/types/structs.gen.go @@ -1,49 +1,38 @@ -// Source: lemmy/crates/db_views_actor/src/structs.rs +// Source: lemmy/crates/api_common/src/websocket/structs.rs // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. package types -type CommunityBlockView struct { - Person PersonSafe `json:"person" url:"person,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` +type UserJoin struct { + Auth string `json:"auth" url:"auth,omitempty"` } -type CommunityFollowerView struct { - Community CommunitySafe `json:"community" url:"community,omitempty"` - Follower PersonSafe `json:"follower" url:"follower,omitempty"` +type UserJoinResponse struct { + Joined bool `json:"joined" url:"joined,omitempty"` + LemmyResponse } -type CommunityModeratorView struct { - Community CommunitySafe `json:"community" url:"community,omitempty"` - Moderator PersonSafe `json:"moderator" url:"moderator,omitempty"` +type CommunityJoin struct { + CommunityID int `json:"community_id" url:"community_id,omitempty"` } -type CommunityPersonBanView struct { - Community CommunitySafe `json:"community" url:"community,omitempty"` - Person PersonSafe `json:"person" url:"person,omitempty"` +type CommunityJoinResponse struct { + Joined bool `json:"joined" url:"joined,omitempty"` + LemmyResponse } -type CommunityView struct { - Community CommunitySafe `json:"community" url:"community,omitempty"` - Subscribed bool `json:"subscribed" url:"subscribed,omitempty"` - Blocked bool `json:"blocked" url:"blocked,omitempty"` - Counts CommunityAggregates `json:"counts" url:"counts,omitempty"` +type ModJoin struct { + CommunityID int `json:"community_id" url:"community_id,omitempty"` } -type PersonBlockView struct { - Person PersonSafe `json:"person" url:"person,omitempty"` - Target PersonSafeAlias1 `json:"target" url:"target,omitempty"` +type ModJoinResponse struct { + Joined bool `json:"joined" url:"joined,omitempty"` + LemmyResponse } -type PersonMentionView struct { - PersonMention PersonMention `json:"person_mention" url:"person_mention,omitempty"` - Comment Comment `json:"comment" url:"comment,omitempty"` - Creator PersonSafe `json:"creator" url:"creator,omitempty"` - Post Post `json:"post" url:"post,omitempty"` - Community CommunitySafe `json:"community" url:"community,omitempty"` - Recipient PersonSafeAlias1 `json:"recipient" url:"recipient,omitempty"` - Counts CommentAggregates `json:"counts" url:"counts,omitempty"` - CreatorBannedFromCommunity bool `json:"creator_banned_from_community" url:"creator_banned_from_community,omitempty"` - Subscribed bool `json:"subscribed" url:"subscribed,omitempty"` - Saved bool `json:"saved" url:"saved,omitempty"` - CreatorBlocked bool `json:"creator_blocked" url:"creator_blocked,omitempty"` - MyVote Optional[int16] `json:"my_vote" url:"my_vote,omitempty"` +type PostJoin struct { + PostID int `json:"post_id" url:"post_id,omitempty"` } -type PersonViewSafe struct { - Person PersonSafe `json:"person" url:"person,omitempty"` - Counts PersonAggregates `json:"counts" url:"counts,omitempty"` +type PostJoinResponse struct { + Joined bool `json:"joined" url:"joined,omitempty"` + LemmyResponse +} +type CaptchaItem struct { + Uuid string `json:"uuid" url:"uuid,omitempty"` + Answer string `json:"answer" url:"answer,omitempty"` + Expires LemmyTime `json:"expires" url:"expires,omitempty"` } diff --git a/types/tagline.gen.go b/types/tagline.gen.go new file mode 100644 index 0000000..d31650f --- /dev/null +++ b/types/tagline.gen.go @@ -0,0 +1,17 @@ +// Source: lemmy/crates/db_schema/src/source/tagline.rs +// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. + +package types + +type Tagline struct { + ID int32 `json:"id" url:"id,omitempty"` + LocalSiteID int `json:"local_site_id" url:"local_site_id,omitempty"` + Content string `json:"content" url:"content,omitempty"` + Published LemmyTime `json:"published" url:"published,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` +} +type TaglineForm struct { + LocalSiteID int `json:"local_site_id" url:"local_site_id,omitempty"` + Content string `json:"content" url:"content,omitempty"` + Updated LemmyTime `json:"updated" url:"updated,omitempty"` +} diff --git a/types/types.go b/types/types.go index 98228ce..6136d8c 100644 --- a/types/types.go +++ b/types/types.go @@ -79,3 +79,7 @@ func (u UserOperation) Operation() string { func (u UserOperationCRUD) Operation() string { return string(u) } + +func (u UserOperationApub) Operation() string { + return string(u) +} diff --git a/types/utils.gen.go b/types/utils.gen.go index dc8331f..141aa1a 100644 --- a/types/utils.gen.go +++ b/types/utils.gen.go @@ -2,3 +2,13 @@ // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. package types + +type EndpointType string + +const ( + EndpointTypeCommunity EndpointType = "Community" + EndpointTypePerson EndpointType = "Person" + EndpointTypePost EndpointType = "Post" + EndpointTypeComment EndpointType = "Comment" + EndpointTypePrivateMessage EndpointType = "PrivateMessage" +) diff --git a/types/websocket.gen.go b/types/websocket.gen.go deleted file mode 100644 index 547216c..0000000 --- a/types/websocket.gen.go +++ /dev/null @@ -1,33 +0,0 @@ -// Source: lemmy/crates/api_common/src/websocket.rs -// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. - -package types - -type UserJoin struct { - Auth string `json:"auth" url:"auth,omitempty"` -} -type UserJoinResponse struct { - Joined bool `json:"joined" url:"joined,omitempty"` - LemmyResponse -} -type CommunityJoin struct { - CommunityID int `json:"community_id" url:"community_id,omitempty"` -} -type CommunityJoinResponse struct { - Joined bool `json:"joined" url:"joined,omitempty"` - LemmyResponse -} -type ModJoin struct { - CommunityID int `json:"community_id" url:"community_id,omitempty"` -} -type ModJoinResponse struct { - Joined bool `json:"joined" url:"joined,omitempty"` - LemmyResponse -} -type PostJoin struct { - PostID int `json:"post_id" url:"post_id,omitempty"` -} -type PostJoinResponse struct { - Joined bool `json:"joined" url:"joined,omitempty"` - LemmyResponse -}