Update for 0.18.0

This commit is contained in:
Elara 2023-07-03 17:47:46 -07:00
parent ff36330625
commit 058b3879ae
36 changed files with 603 additions and 1027 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
/test
/gen
/gen
/lemmy/

View File

@ -118,6 +118,7 @@ func (s *StructParser) Parse() ([]Item, error) {
}
func (s *StructParser) parseStructFields() ([]Field, error) {
encountered := map[string]struct{}{}
var out []Field
for {
line, err := s.r.ReadString('\n')
@ -144,6 +145,12 @@ func (s *StructParser) parseStructFields() ([]Field, error) {
continue
}
if _, ok := encountered[sm[1]]; ok {
continue
} else {
encountered[sm[1]] = struct{}{}
}
out = append(out, Field{
OrigName: sm[1],
Name: s.TransformName(sm[1]),

View File

@ -224,21 +224,9 @@ func (c *Client) AddModToCommunity(ctx context.Context, data types.AddModToCommu
}
return resData, nil
}
func (c *Client) CommunityJoin(ctx context.Context, data types.CommunityJoin) (*types.CommunityJoinResponse, error) {
resData := &types.CommunityJoinResponse{}
res, err := c.req(ctx, "POST", "/community/join", 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) ModJoin(ctx context.Context, data types.ModJoin) (*types.ModJoinResponse, error) {
resData := &types.ModJoinResponse{}
res, err := c.req(ctx, "POST", "/community/mod/join", data, &resData)
func (c *Client) FederatedInstances(ctx context.Context, data types.GetFederatedInstances) (*types.GetFederatedInstancesResponse, error) {
resData := &types.GetFederatedInstancesResponse{}
res, err := c.getReq(ctx, "GET", "/federated_instances", data, &resData)
if err != nil {
return nil, err
}
@ -380,18 +368,6 @@ func (c *Client) SavePost(ctx context.Context, data types.SavePost) (*types.Post
}
return resData, nil
}
func (c *Client) PostJoin(ctx context.Context, data types.PostJoin) (*types.PostJoinResponse, error) {
resData := &types.PostJoinResponse{}
res, err := c.req(ctx, "POST", "/post/join", 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) CreatePostReport(ctx context.Context, data types.CreatePostReport) (*types.PostReportResponse, error) {
resData := &types.PostReportResponse{}
res, err := c.req(ctx, "POST", "/post/report", data, &resData)
@ -512,6 +488,18 @@ func (c *Client) MarkCommentReplyAsRead(ctx context.Context, data types.MarkComm
}
return resData, nil
}
func (c *Client) DistinguishComment(ctx context.Context, data types.DistinguishComment) (*types.CommentResponse, error) {
resData := &types.CommentResponse{}
res, err := c.req(ctx, "POST", "/comment/distinguish", 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) CreateCommentLike(ctx context.Context, data types.CreateCommentLike) (*types.CommentResponse, error) {
resData := &types.CommentResponse{}
res, err := c.req(ctx, "POST", "/comment/like", data, &resData)
@ -692,18 +680,6 @@ func (c *Client) Register(ctx context.Context, data types.Register) (*types.Logi
}
return resData, nil
}
func (c *Client) Captcha(ctx context.Context, data types.GetCaptcha) (*types.GetCaptchaResponse, error) {
resData := &types.GetCaptchaResponse{}
res, err := c.getReq(ctx, "GET", "/user/get_captcha", 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) PersonDetails(ctx context.Context, data types.GetPersonDetails) (*types.GetPersonDetailsResponse, error) {
resData := &types.GetPersonDetailsResponse{}
res, err := c.getReq(ctx, "GET", "/user", data, &resData)
@ -752,18 +728,6 @@ func (c *Client) Replies(ctx context.Context, data types.GetReplies) (*types.Get
}
return resData, nil
}
func (c *Client) UserJoin(ctx context.Context, data types.UserJoin) (*types.UserJoinResponse, error) {
resData := &types.UserJoinResponse{}
res, err := c.req(ctx, "POST", "/user/join", 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) BanPerson(ctx context.Context, data types.BanPerson) (*types.BanPersonResponse, error) {
resData := &types.BanPersonResponse{}
res, err := c.req(ctx, "POST", "/user/ban", data, &resData)
@ -982,7 +946,7 @@ func (c *Client) ApproveRegistrationApplication(ctx context.Context, data types.
}
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)
res, err := c.req(ctx, "POST", "/admin/person", data, &resData)
if err != nil {
return nil, err
}
@ -994,7 +958,7 @@ func (c *Client) PurgePerson(ctx context.Context, data types.PurgePerson) (*type
}
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)
res, err := c.req(ctx, "POST", "/admin/community", data, &resData)
if err != nil {
return nil, err
}
@ -1006,7 +970,7 @@ func (c *Client) PurgeCommunity(ctx context.Context, data types.PurgeCommunity)
}
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)
res, err := c.req(ctx, "POST", "/admin/post", data, &resData)
if err != nil {
return nil, err
}
@ -1018,7 +982,43 @@ func (c *Client) PurgePost(ctx context.Context, data types.PurgePost) (*types.Pu
}
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)
res, err := c.req(ctx, "POST", "/admin/comment", 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) CreateCustomEmoji(ctx context.Context, data types.CreateCustomEmoji) (*types.CustomEmojiResponse, error) {
resData := &types.CustomEmojiResponse{}
res, err := c.req(ctx, "POST", "/custom_emoji", 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) EditCustomEmoji(ctx context.Context, data types.EditCustomEmoji) (*types.CustomEmojiResponse, error) {
resData := &types.CustomEmojiResponse{}
res, err := c.req(ctx, "PUT", "/custom_emoji", 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) DeleteCustomEmoji(ctx context.Context, data types.DeleteCustomEmoji) (*types.DeleteCustomEmojiResponse, error) {
resData := &types.DeleteCustomEmojiResponse{}
res, err := c.req(ctx, "POST", "/custom_emoji/delete", data, &resData)
if err != nil {
return nil, err
}

View File

@ -4,13 +4,13 @@
package types
type Activity struct {
ID int32 `json:"id" url:"id,omitempty"`
Data any `json:"data" url:"data,omitempty"`
Local bool `json:"local" url:"local,omitempty"`
Published LemmyTime `json:"published" url:"published,omitempty"`
Updated LemmyTime `json:"updated" url:"updated,omitempty"`
ApID string `json:"ap_id" url:"ap_id,omitempty"`
Sensitive Optional[bool] `json:"sensitive" url:"sensitive,omitempty"`
ID int32 `json:"id" url:"id,omitempty"`
Data any `json:"data" url:"data,omitempty"`
Local bool `json:"local" url:"local,omitempty"`
Published LemmyTime `json:"published" url:"published,omitempty"`
Updated LemmyTime `json:"updated" url:"updated,omitempty"`
ApID string `json:"ap_id" url:"ap_id,omitempty"`
Sensitive bool `json:"sensitive" url:"sensitive,omitempty"`
}
type ActivityInsertForm struct {
Data any `json:"data" url:"data,omitempty"`
@ -20,8 +20,8 @@ type ActivityInsertForm struct {
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"`
Data any `json:"data" url:"data,omitempty"`
Local Optional[bool] `json:"local" url:"local,omitempty"`
Updated LemmyTime `json:"updated" url:"updated,omitempty"`
Sensitive Optional[bool] `json:"sensitive" url:"sensitive,omitempty"`
}

View File

@ -1,4 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/mod.rs
// Source: lemmy/crates/api_common/src/build_response.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types

View File

@ -1,12 +0,0 @@
// Source: lemmy/crates/api_common/src/websocket/handlers/captcha.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type AddCaptcha struct {
Captcha CaptchaItem `json:"captcha" url:"captcha,omitempty"`
}
type CheckCaptcha struct {
Uuid string `json:"uuid" url:"uuid,omitempty"`
Answer string `json:"answer" url:"answer,omitempty"`
}

View File

@ -16,12 +16,16 @@ type GetComment struct {
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
}
type EditComment struct {
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"`
CommentID int `json:"comment_id" url:"comment_id,omitempty"`
Content Optional[string] `json:"content" url:"content,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 DistinguishComment struct {
CommentID int `json:"comment_id" url:"comment_id,omitempty"`
Distinguished bool `json:"distinguished" url:"distinguished,omitempty"`
Auth string `json:"auth" url:"auth,omitempty"`
}
type DeleteComment struct {
CommentID int `json:"comment_id" url:"comment_id,omitempty"`

View File

@ -23,29 +23,11 @@ type Community struct {
FollowersURL string `json:"followers_url" url:"followers_url,omitempty"`
InboxURL string `json:"inbox_url" url:"inbox_url,omitempty"`
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"`
ModeratorsURL Optional[string] `json:"moderators_url" url:"moderators_url,omitempty"`
FeaturedURL Optional[string] `json:"featured_url" url:"featured_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"`
Name string `json:"name" url:"name,omitempty"`
Title string `json:"title" url:"title,omitempty"`
Description Optional[string] `json:"description" url:"description,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"`
NSFW bool `json:"nsfw" url:"nsfw,omitempty"`
ActorID string `json:"actor_id" url:"actor_id,omitempty"`
Local bool `json:"local" url:"local,omitempty"`
Icon Optional[string] `json:"icon" url:"icon,omitempty"`
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 CommunityInsertForm struct {
Name string `json:"name" url:"name,omitempty"`

View File

@ -12,9 +12,7 @@ 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"`
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 {
@ -54,8 +52,8 @@ type BanFromCommunity struct {
Auth string `json:"auth" url:"auth,omitempty"`
}
type BanFromCommunityResponse struct {
PersonView PersonViewSafe `json:"person_view" url:"person_view,omitempty"`
Banned bool `json:"banned" url:"banned,omitempty"`
PersonView PersonView `json:"person_view" url:"person_view,omitempty"`
Banned bool `json:"banned" url:"banned,omitempty"`
LemmyResponse
}
type AddModToCommunity struct {

View File

@ -1,8 +0,0 @@
// Source: lemmy/crates/api_common/src/websocket/handlers/connect.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type Disconnect struct {
ID int `json:"id" url:"id,omitempty"`
}

View File

@ -0,0 +1,28 @@
// Source: lemmy/crates/db_schema/src/source/custom_emoji.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type CustomEmoji struct {
ID int `json:"id" url:"id,omitempty"`
LocalSiteID int `json:"local_site_id" url:"local_site_id,omitempty"`
Shortcode string `json:"shortcode" url:"shortcode,omitempty"`
ImageURL string `json:"image_url" url:"image_url,omitempty"`
AltText string `json:"alt_text" url:"alt_text,omitempty"`
Category string `json:"category" url:"category,omitempty"`
Published LemmyTime `json:"published" url:"published,omitempty"`
Updated LemmyTime `json:"updated" url:"updated,omitempty"`
}
type CustomEmojiInsertForm struct {
LocalSiteID int `json:"local_site_id" url:"local_site_id,omitempty"`
Shortcode string `json:"shortcode" url:"shortcode,omitempty"`
ImageURL string `json:"image_url" url:"image_url,omitempty"`
AltText string `json:"alt_text" url:"alt_text,omitempty"`
Category string `json:"category" url:"category,omitempty"`
}
type CustomEmojiUpdateForm struct {
LocalSiteID int `json:"local_site_id" url:"local_site_id,omitempty"`
ImageURL string `json:"image_url" url:"image_url,omitempty"`
AltText string `json:"alt_text" url:"alt_text,omitempty"`
Category string `json:"category" url:"category,omitempty"`
}

34
types/custom_emoji.gen.go Normal file
View File

@ -0,0 +1,34 @@
// Source: lemmy/crates/api_common/src/custom_emoji.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type CreateCustomEmoji struct {
Category string `json:"category" url:"category,omitempty"`
Shortcode string `json:"shortcode" url:"shortcode,omitempty"`
ImageURL string `json:"image_url" url:"image_url,omitempty"`
AltText string `json:"alt_text" url:"alt_text,omitempty"`
Keywords []string `json:"keywords" url:"keywords,omitempty"`
Auth string `json:"auth" url:"auth,omitempty"`
}
type EditCustomEmoji struct {
ID int `json:"id" url:"id,omitempty"`
Category string `json:"category" url:"category,omitempty"`
ImageURL string `json:"image_url" url:"image_url,omitempty"`
AltText string `json:"alt_text" url:"alt_text,omitempty"`
Keywords []string `json:"keywords" url:"keywords,omitempty"`
Auth string `json:"auth" url:"auth,omitempty"`
}
type DeleteCustomEmoji struct {
ID int `json:"id" url:"id,omitempty"`
Auth string `json:"auth" url:"auth,omitempty"`
}
type DeleteCustomEmojiResponse struct {
ID int `json:"id" url:"id,omitempty"`
Success bool `json:"success" url:"success,omitempty"`
LemmyResponse
}
type CustomEmojiResponse struct {
CustomEmoji CustomEmojiView `json:"custom_emoji" url:"custom_emoji,omitempty"`
LemmyResponse
}

View File

@ -0,0 +1,14 @@
// Source: lemmy/crates/db_schema/src/source/custom_emoji_keyword.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type CustomEmojiKeyword struct {
ID int32 `json:"id" url:"id,omitempty"`
CustomEmojiID int `json:"custom_emoji_id" url:"custom_emoji_id,omitempty"`
Keyword string `json:"keyword" url:"keyword,omitempty"`
}
type CustomEmojiKeywordInsertForm struct {
CustomEmojiID int `json:"custom_emoji_id" url:"custom_emoji_id,omitempty"`
Keyword string `json:"keyword" url:"keyword,omitempty"`
}

View File

@ -4,12 +4,16 @@
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"`
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"`
Software Optional[string] `json:"software" url:"software,omitempty"`
Version Optional[string] `json:"version" url:"version,omitempty"`
}
type InstanceForm struct {
Domain string `json:"domain" url:"domain,omitempty"`
Updated LemmyTime `json:"updated" url:"updated,omitempty"`
Domain string `json:"domain" url:"domain,omitempty"`
Software Optional[string] `json:"software" url:"software,omitempty"`
Version Optional[string] `json:"version" url:"version,omitempty"`
Updated LemmyTime `json:"updated" url:"updated,omitempty"`
}

View File

@ -1,21 +0,0 @@
// Source: lemmy/crates/api_common/src/websocket/handlers/join_rooms.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type JoinPostRoom struct {
PostID int `json:"post_id" url:"post_id,omitempty"`
ID int `json:"id" url:"id,omitempty"`
}
type JoinCommunityRoom struct {
CommunityID int `json:"community_id" url:"community_id,omitempty"`
ID int `json:"id" url:"id,omitempty"`
}
type JoinModRoom struct {
CommunityID int `json:"community_id" url:"community_id,omitempty"`
ID int `json:"id" url:"id,omitempty"`
}
type JoinUserRoom struct {
UserID int `json:"user_id" url:"user_id,omitempty"`
ID int `json:"id" url:"id,omitempty"`
}

View File

@ -6,17 +6,20 @@ package types
type SortType string
const (
SortTypeActive SortType = "Active"
SortTypeHot SortType = "Hot"
SortTypeNew SortType = "New"
SortTypeOld SortType = "Old"
SortTypeTopDay SortType = "TopDay"
SortTypeTopWeek SortType = "TopWeek"
SortTypeTopMonth SortType = "TopMonth"
SortTypeTopYear SortType = "TopYear"
SortTypeTopAll SortType = "TopAll"
SortTypeMostComments SortType = "MostComments"
SortTypeNewComments SortType = "NewComments"
SortTypeActive SortType = "Active"
SortTypeHot SortType = "Hot"
SortTypeNew SortType = "New"
SortTypeOld SortType = "Old"
SortTypeTopDay SortType = "TopDay"
SortTypeTopWeek SortType = "TopWeek"
SortTypeTopMonth SortType = "TopMonth"
SortTypeTopYear SortType = "TopYear"
SortTypeTopAll SortType = "TopAll"
SortTypeMostComments SortType = "MostComments"
SortTypeNewComments SortType = "NewComments"
SortTypeTopHour SortType = "TopHour"
SortTypeTopSixHour SortType = "TopSixHour"
SortTypeTopTwelveHour SortType = "TopTwelveHour"
)
type CommentSortType string
@ -36,6 +39,14 @@ const (
ListingTypeSubscribed ListingType = "Subscribed"
)
type RegistrationMode string
const (
RegistrationModeClosed RegistrationMode = "Closed"
RegistrationModeRequireApplication RegistrationMode = "RequireApplication"
RegistrationModeOpen RegistrationMode = "Open"
)
type SearchType string
const (

View File

@ -14,21 +14,20 @@ type LocalSite struct {
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"`
DefaultPostListingType ListingType `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"`
ReportsEmailAdmins bool `json:"reports_email_admins" url:"reports_email_admins,omitempty"`
Published LemmyTime `json:"published" url:"published,omitempty"`
Updated LemmyTime `json:"updated" url:"updated,omitempty"`
RegistrationMode RegistrationMode `json:"registration_mode" url:"registration_mode,omitempty"`
ReportsEmailAdmins bool `json:"reports_email_admins" url:"reports_email_admins,omitempty"`
}
type LocalSiteInsertForm struct {
SiteID int `json:"site_id" url:"site_id,omitempty"`
@ -40,14 +39,13 @@ type LocalSiteInsertForm struct {
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"`
DefaultPostListingType Optional[ListingType] `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"`
@ -63,14 +61,13 @@ type LocalSiteUpdateForm struct {
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"`
DefaultPostListingType Optional[ListingType] `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"`
@ -78,10 +75,3 @@ type LocalSiteUpdateForm struct {
ReportsEmailAdmins Optional[bool] `json:"reports_email_admins" url:"reports_email_admins,omitempty"`
Updated LemmyTime `json:"updated" url:"updated,omitempty"`
}
type RegistrationMode string
const (
RegistrationModeClosed RegistrationMode = "Closed"
RegistrationModeRequireApplication RegistrationMode = "RequireApplication"
RegistrationModeOpen RegistrationMode = "Open"
)

View File

@ -10,63 +10,29 @@ type LocalUser struct {
Email Optional[string] `json:"email" url:"email,omitempty"`
ShowNSFW bool `json:"show_nsfw" url:"show_nsfw,omitempty"`
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"`
DefaultSortType SortType `json:"default_sort_type" url:"default_sort_type,omitempty"`
DefaultListingType ListingType `json:"default_listing_type" url:"default_listing_type,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"`
ShowBotAccounts bool `json:"show_bot_accounts" url:"show_bot_accounts,omitempty"`
ShowScores bool `json:"show_scores" url:"show_scores,omitempty"`
ShowReadPosts bool `json:"show_read_posts" url:"show_read_posts,omitempty"`
ShowNewPostNotifs bool `json:"show_new_post_notifs" url:"show_new_post_notifs,omitempty"`
EmailVerified bool `json:"email_verified" url:"email_verified,omitempty"`
AcceptedApplication 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"`
Email Optional[string] `json:"email" url:"email,omitempty"`
ShowNSFW bool `json:"show_nsfw" url:"show_nsfw,omitempty"`
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"`
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"`
ShowBotAccounts bool `json:"show_bot_accounts" url:"show_bot_accounts,omitempty"`
ShowScores bool `json:"show_scores" url:"show_scores,omitempty"`
ShowBotAccounts bool `json:"show_bot_accounts" url:"show_bot_accounts,omitempty"`
ShowReadPosts bool `json:"show_read_posts" url:"show_read_posts,omitempty"`
ShowNewPostNotifs bool `json:"show_new_post_notifs" url:"show_new_post_notifs,omitempty"`
EmailVerified bool `json:"email_verified" url:"email_verified,omitempty"`
AcceptedApplication bool `json:"accepted_application" url:"accepted_application,omitempty"`
Totp2faSecret Optional[string] `json:"totp_2fa_secret" url:"totp_2fa_secret,omitempty"`
Totp2faURL Optional[string] `json:"totp_2fa_url" url:"totp_2fa_url,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"`
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"`
DefaultSortType Optional[SortType] `json:"default_sort_type" url:"default_sort_type,omitempty"`
DefaultListingType Optional[ListingType] `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"`
@ -76,4 +42,25 @@ type LocalUserUpdateForm struct {
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"`
Totp2faSecret Optional[Optional[string]] `json:"totp_2fa_secret" url:"totp_2fa_secret,omitempty"`
Totp2faURL Optional[Optional[string]] `json:"totp_2fa_url" url:"totp_2fa_url,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[SortType] `json:"default_sort_type" url:"default_sort_type,omitempty"`
DefaultListingType Optional[ListingType] `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"`
Totp2faSecret Optional[Optional[string]] `json:"totp_2fa_secret" url:"totp_2fa_secret,omitempty"`
Totp2faURL Optional[Optional[string]] `json:"totp_2fa_url" url:"totp_2fa_url,omitempty"`
}

View File

@ -1,29 +0,0 @@
// Source: lemmy/crates/api_common/src/websocket/handlers/messages.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type SendPostRoomMessage struct {
PostID int `json:"post_id" url:"post_id,omitempty"`
Message string `json:"message" url:"message,omitempty"`
WebsocketID Optional[int] `json:"websocket_id" url:"websocket_id,omitempty"`
}
type SendCommunityRoomMessage struct {
CommunityID int `json:"community_id" url:"community_id,omitempty"`
Message string `json:"message" url:"message,omitempty"`
WebsocketID Optional[int] `json:"websocket_id" url:"websocket_id,omitempty"`
}
type SendModRoomMessage struct {
CommunityID int `json:"community_id" url:"community_id,omitempty"`
Message string `json:"message" url:"message,omitempty"`
WebsocketID Optional[int] `json:"websocket_id" url:"websocket_id,omitempty"`
}
type SendUserRoomMessage struct {
RecipientID int `json:"recipient_id" url:"recipient_id,omitempty"`
Message string `json:"message" url:"message,omitempty"`
WebsocketID Optional[int] `json:"websocket_id" url:"websocket_id,omitempty"`
}
type SendAllMessage struct {
Message string `json:"message" url:"message,omitempty"`
WebsocketID Optional[int] `json:"websocket_id" url:"websocket_id,omitempty"`
}

View File

@ -1,103 +0,0 @@
// Source: lemmy/crates/api_common/src/websocket/mod.rs
// Code generated by go.elara.ws/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"
)

View File

@ -1,4 +1,4 @@
// Source: lemmy/crates/api_common/src/websocket/handlers/mod.rs
// Source: lemmy/crates/db_schema/src/source/mod.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types

View File

@ -8,7 +8,7 @@ type ModRemovePost struct {
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
PostID int `json:"post_id" url:"post_id,omitempty"`
Reason Optional[string] `json:"reason" url:"reason,omitempty"`
Removed Optional[bool] `json:"removed" url:"removed,omitempty"`
Removed bool `json:"removed" url:"removed,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
}
type ModRemovePostForm struct {
@ -18,11 +18,11 @@ type ModRemovePostForm struct {
Removed Optional[bool] `json:"removed" url:"removed,omitempty"`
}
type ModLockPost 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"`
Locked Optional[bool] `json:"locked" url:"locked,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
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"`
Locked bool `json:"locked" url:"locked,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
}
type ModLockPostForm struct {
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
@ -48,7 +48,7 @@ type ModRemoveComment struct {
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
CommentID int `json:"comment_id" url:"comment_id,omitempty"`
Reason Optional[string] `json:"reason" url:"reason,omitempty"`
Removed Optional[bool] `json:"removed" url:"removed,omitempty"`
Removed bool `json:"removed" url:"removed,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
}
type ModRemoveCommentForm struct {
@ -62,7 +62,7 @@ type ModRemoveCommunity struct {
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
CommunityID int `json:"community_id" url:"community_id,omitempty"`
Reason Optional[string] `json:"reason" url:"reason,omitempty"`
Removed Optional[bool] `json:"removed" url:"removed,omitempty"`
Removed bool `json:"removed" url:"removed,omitempty"`
Expires LemmyTime `json:"expires" url:"expires,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
}
@ -79,7 +79,7 @@ type ModBanFromCommunity struct {
OtherPersonID int `json:"other_person_id" url:"other_person_id,omitempty"`
CommunityID int `json:"community_id" url:"community_id,omitempty"`
Reason Optional[string] `json:"reason" url:"reason,omitempty"`
Banned Optional[bool] `json:"banned" url:"banned,omitempty"`
Banned bool `json:"banned" url:"banned,omitempty"`
Expires LemmyTime `json:"expires" url:"expires,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
}
@ -96,7 +96,7 @@ type ModBan struct {
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
OtherPersonID int `json:"other_person_id" url:"other_person_id,omitempty"`
Reason Optional[string] `json:"reason" url:"reason,omitempty"`
Banned Optional[bool] `json:"banned" url:"banned,omitempty"`
Banned bool `json:"banned" url:"banned,omitempty"`
Expires LemmyTime `json:"expires" url:"expires,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
}
@ -110,9 +110,9 @@ type ModHideCommunity struct {
ID int32 `json:"id" url:"id,omitempty"`
CommunityID int `json:"community_id" url:"community_id,omitempty"`
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
Reason Optional[string] `json:"reason" url:"reason,omitempty"`
Hidden Optional[bool] `json:"hidden" url:"hidden,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
Reason Optional[string] `json:"reason" url:"reason,omitempty"`
Hidden bool `json:"hidden" url:"hidden,omitempty"`
}
type ModBanForm struct {
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
@ -122,12 +122,12 @@ type ModBanForm struct {
Expires LemmyTime `json:"expires" url:"expires,omitempty"`
}
type ModAddCommunity struct {
ID int32 `json:"id" url:"id,omitempty"`
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
OtherPersonID int `json:"other_person_id" url:"other_person_id,omitempty"`
CommunityID int `json:"community_id" url:"community_id,omitempty"`
Removed Optional[bool] `json:"removed" url:"removed,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
ID int32 `json:"id" url:"id,omitempty"`
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
OtherPersonID int `json:"other_person_id" url:"other_person_id,omitempty"`
CommunityID int `json:"community_id" url:"community_id,omitempty"`
Removed bool `json:"removed" url:"removed,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
}
type ModAddCommunityForm struct {
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
@ -136,25 +136,23 @@ type ModAddCommunityForm struct {
Removed Optional[bool] `json:"removed" url:"removed,omitempty"`
}
type ModTransferCommunity struct {
ID int32 `json:"id" url:"id,omitempty"`
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
OtherPersonID int `json:"other_person_id" url:"other_person_id,omitempty"`
CommunityID int `json:"community_id" url:"community_id,omitempty"`
Removed Optional[bool] `json:"removed" url:"removed,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
ID int32 `json:"id" url:"id,omitempty"`
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
OtherPersonID int `json:"other_person_id" url:"other_person_id,omitempty"`
CommunityID int `json:"community_id" url:"community_id,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
}
type ModTransferCommunityForm struct {
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
OtherPersonID int `json:"other_person_id" url:"other_person_id,omitempty"`
CommunityID int `json:"community_id" url:"community_id,omitempty"`
Removed Optional[bool] `json:"removed" url:"removed,omitempty"`
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
OtherPersonID int `json:"other_person_id" url:"other_person_id,omitempty"`
CommunityID int `json:"community_id" url:"community_id,omitempty"`
}
type ModAdd struct {
ID int32 `json:"id" url:"id,omitempty"`
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
OtherPersonID int `json:"other_person_id" url:"other_person_id,omitempty"`
Removed Optional[bool] `json:"removed" url:"removed,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
ID int32 `json:"id" url:"id,omitempty"`
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`
OtherPersonID int `json:"other_person_id" url:"other_person_id,omitempty"`
Removed bool `json:"removed" url:"removed,omitempty"`
When LemmyTime `json:"when_" url:"when_,omitempty"`
}
type ModAddForm struct {
ModPersonID int `json:"mod_person_id" url:"mod_person_id,omitempty"`

View File

@ -1,11 +0,0 @@
// Source: lemmy/crates/api_common/src/websocket/handlers/online_users.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type GetPostUsersOnline struct {
PostID int `json:"post_id" url:"post_id,omitempty"`
}
type GetCommunityUsersOnline struct {
CommunityID int `json:"community_id" url:"community_id,omitempty"`
}

View File

@ -27,27 +27,6 @@ type Person struct {
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"`
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"`
InstanceID int `json:"instance_id" url:"instance_id,omitempty"`
}
type PersonInsertForm struct {
Name string `json:"name" url:"name,omitempty"`
PublicKey string `json:"public_key" url:"public_key,omitempty"`

View File

@ -4,8 +4,9 @@
package types
type Login struct {
UsernameOrEmail string `json:"username_or_email" url:"username_or_email,omitempty"`
Password string `json:"password" url:"password,omitempty"`
UsernameOrEmail string `json:"username_or_email" url:"username_or_email,omitempty"`
Password string `json:"password" url:"password,omitempty"`
Totp2faToken Optional[string] `json:"totp_2fa_token" url:"totp_2fa_token,omitempty"`
}
type Register struct {
Username string `json:"username" url:"username,omitempty"`
@ -32,26 +33,27 @@ type CaptchaResponse struct {
LemmyResponse
}
type SaveUserSettings struct {
ShowNSFW Optional[bool] `json:"show_nsfw" url:"show_nsfw,omitempty"`
ShowScores Optional[bool] `json:"show_scores" url:"show_scores,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"`
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"`
Email Optional[string] `json:"email" url:"email,omitempty"`
Bio Optional[string] `json:"bio" url:"bio,omitempty"`
MatrixUserID Optional[string] `json:"matrix_user_id" url:"matrix_user_id,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"`
BotAccount Optional[bool] `json:"bot_account" url:"bot_account,omitempty"`
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"`
ShowNSFW Optional[bool] `json:"show_nsfw" url:"show_nsfw,omitempty"`
ShowScores Optional[bool] `json:"show_scores" url:"show_scores,omitempty"`
Theme Optional[string] `json:"theme" url:"theme,omitempty"`
DefaultSortType Optional[SortType] `json:"default_sort_type" url:"default_sort_type,omitempty"`
DefaultListingType Optional[ListingType] `json:"default_listing_type" url:"default_listing_type,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"`
Email Optional[string] `json:"email" url:"email,omitempty"`
Bio Optional[string] `json:"bio" url:"bio,omitempty"`
MatrixUserID Optional[string] `json:"matrix_user_id" url:"matrix_user_id,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"`
BotAccount Optional[bool] `json:"bot_account" url:"bot_account,omitempty"`
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"`
GenerateTotp2fa Optional[bool] `json:"generate_totp_2fa" url:"generate_totp_2fa,omitempty"`
Auth string `json:"auth" url:"auth,omitempty"`
}
type ChangePassword struct {
NewPassword string `json:"new_password" url:"new_password,omitempty"`
@ -76,20 +78,12 @@ type GetPersonDetails struct {
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
}
type GetPersonDetailsResponse struct {
PersonView PersonViewSafe `json:"person_view" url:"person_view,omitempty"`
PersonView PersonView `json:"person_view" url:"person_view,omitempty"`
Comments []CommentView `json:"comments" url:"comments,omitempty"`
Posts []PostView `json:"posts" url:"posts,omitempty"`
Moderates []CommunityModeratorView `json:"moderates" url:"moderates,omitempty"`
LemmyResponse
}
type GetRepliesResponse struct {
Replies []CommentReplyView `json:"replies" url:"replies,omitempty"`
LemmyResponse
}
type GetPersonMentionsResponse struct {
Mentions []PersonMentionView `json:"mentions" url:"mentions,omitempty"`
LemmyResponse
}
type MarkAllAsRead struct {
Auth string `json:"auth" url:"auth,omitempty"`
}
@ -99,7 +93,7 @@ type AddAdmin struct {
Auth string `json:"auth" url:"auth,omitempty"`
}
type AddAdminResponse struct {
Admins []PersonViewSafe `json:"admins" url:"admins,omitempty"`
Admins []PersonView `json:"admins" url:"admins,omitempty"`
LemmyResponse
}
type BanPerson struct {
@ -114,12 +108,12 @@ type GetBannedPersons struct {
Auth string `json:"auth" url:"auth,omitempty"`
}
type BannedPersonsResponse struct {
Banned []PersonViewSafe `json:"banned" url:"banned,omitempty"`
Banned []PersonView `json:"banned" url:"banned,omitempty"`
LemmyResponse
}
type BanPersonResponse struct {
PersonView PersonViewSafe `json:"person_view" url:"person_view,omitempty"`
Banned bool `json:"banned" url:"banned,omitempty"`
PersonView PersonView `json:"person_view" url:"person_view,omitempty"`
Banned bool `json:"banned" url:"banned,omitempty"`
LemmyResponse
}
type BlockPerson struct {
@ -128,8 +122,8 @@ type BlockPerson struct {
Auth string `json:"auth" url:"auth,omitempty"`
}
type BlockPersonResponse struct {
PersonView PersonViewSafe `json:"person_view" url:"person_view,omitempty"`
Blocked bool `json:"blocked" url:"blocked,omitempty"`
PersonView PersonView `json:"person_view" url:"person_view,omitempty"`
Blocked bool `json:"blocked" url:"blocked,omitempty"`
LemmyResponse
}
type GetReplies struct {
@ -139,6 +133,10 @@ type GetReplies struct {
UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"`
Auth string `json:"auth" url:"auth,omitempty"`
}
type GetRepliesResponse struct {
Replies []CommentReplyView `json:"replies" url:"replies,omitempty"`
LemmyResponse
}
type GetPersonMentions struct {
Sort Optional[CommentSortType] `json:"sort" url:"sort,omitempty"`
Page Optional[int64] `json:"page" url:"page,omitempty"`
@ -146,6 +144,10 @@ type GetPersonMentions struct {
UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"`
Auth string `json:"auth" url:"auth,omitempty"`
}
type GetPersonMentionsResponse struct {
Mentions []PersonMentionView `json:"mentions" url:"mentions,omitempty"`
LemmyResponse
}
type MarkPersonMentionAsRead struct {
PersonMentionID int `json:"person_mention_id" url:"person_mention_id,omitempty"`
Read bool `json:"read" url:"read,omitempty"`

View File

@ -18,10 +18,10 @@ type Post struct {
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"`
EmbedVideoURL Optional[string] `json:"embed_video_url" url:"embed_video_url,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"`

View File

@ -26,7 +26,7 @@ type GetPostResponse struct {
PostView PostView `json:"post_view" url:"post_view,omitempty"`
CommunityView CommunityView `json:"community_view" url:"community_view,omitempty"`
Moderators []CommunityModeratorView `json:"moderators" url:"moderators,omitempty"`
Online uint `json:"online" url:"online,omitempty"`
CrossPosts []PostView `json:"cross_posts" url:"cross_posts,omitempty"`
LemmyResponse
}
type GetPosts struct {

View File

@ -1,4 +0,0 @@
// Source: lemmy/crates/api_common/src/websocket/send.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types

View File

@ -16,22 +16,22 @@ type Search struct {
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
}
type SearchResponse struct {
Type string `json:"type_" url:"type_,omitempty"`
Comments []CommentView `json:"comments" url:"comments,omitempty"`
Posts []PostView `json:"posts" url:"posts,omitempty"`
Communities []CommunityView `json:"communities" url:"communities,omitempty"`
Users []PersonViewSafe `json:"users" url:"users,omitempty"`
Type SearchType `json:"type_" url:"type_,omitempty"`
Comments []CommentView `json:"comments" url:"comments,omitempty"`
Posts []PostView `json:"posts" url:"posts,omitempty"`
Communities []CommunityView `json:"communities" url:"communities,omitempty"`
Users []PersonView `json:"users" url:"users,omitempty"`
LemmyResponse
}
type ResolveObject struct {
Q string `json:"q" url:"q,omitempty"`
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
Q string `json:"q" url:"q,omitempty"`
Auth string `json:"auth" url:"auth,omitempty"`
}
type ResolveObjectResponse struct {
Comment Optional[CommentView] `json:"comment" url:"comment,omitempty"`
Post Optional[PostView] `json:"post" url:"post,omitempty"`
Community Optional[CommunityView] `json:"community" url:"community,omitempty"`
Person Optional[PersonViewSafe] `json:"person" url:"person,omitempty"`
Comment Optional[CommentView] `json:"comment" url:"comment,omitempty"`
Post Optional[PostView] `json:"post" url:"post,omitempty"`
Community Optional[CommunityView] `json:"community" url:"community,omitempty"`
Person Optional[PersonView] `json:"person" url:"person,omitempty"`
LemmyResponse
}
type GetModlog struct {
@ -39,9 +39,9 @@ type GetModlog struct {
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"`
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
}
type GetModlogResponse struct {
RemovedPosts []ModRemovePostView `json:"removed_posts" url:"removed_posts,omitempty"`