// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. // Lexicon schema: chat.bsky.moderation.defs package chat import ( "encoding/json" "fmt" lexutil "github.com/bluesky-social/indigo/lex/util" ) // ModerationDefs_ConvoView is a "convoView" in the chat.bsky.moderation.defs schema. // // [NOTE: This is under active development and should be considered unstable while this note is here]. A view of a conversation for moderation purposes. Unlike chat.bsky.convo.defs#convoView, it does not include viewer-specific data (such as muted, unreadCount, status, lastMessage, lastReaction), since the requester is a moderator and not a member of the conversation. The member list is not included; use chat.bsky.moderation.getConvoMembers to list members. type ModerationDefs_ConvoView struct { Id string `json:"id" cborgen:"id"` // kind: Union field that has data specific to different kinds of convos. Kind *ModerationDefs_ConvoView_Kind `json:"kind,omitempty" cborgen:"kind,omitempty"` Rev string `json:"rev" cborgen:"rev"` } // Union field that has data specific to different kinds of convos. type ModerationDefs_ConvoView_Kind struct { ModerationDefs_DirectConvo *ModerationDefs_DirectConvo ModerationDefs_GroupConvo *ModerationDefs_GroupConvo } func (t *ModerationDefs_ConvoView_Kind) MarshalJSON() ([]byte, error) { if t.ModerationDefs_DirectConvo != nil { t.ModerationDefs_DirectConvo.LexiconTypeID = "chat.bsky.moderation.defs#directConvo" return json.Marshal(t.ModerationDefs_DirectConvo) } if t.ModerationDefs_GroupConvo != nil { t.ModerationDefs_GroupConvo.LexiconTypeID = "chat.bsky.moderation.defs#groupConvo" return json.Marshal(t.ModerationDefs_GroupConvo) } return nil, fmt.Errorf("can not marshal empty union as JSON") } func (t *ModerationDefs_ConvoView_Kind) UnmarshalJSON(b []byte) error { typ, err := lexutil.TypeExtract(b) if err != nil { return err } switch typ { case "chat.bsky.moderation.defs#directConvo": t.ModerationDefs_DirectConvo = new(ModerationDefs_DirectConvo) return json.Unmarshal(b, t.ModerationDefs_DirectConvo) case "chat.bsky.moderation.defs#groupConvo": t.ModerationDefs_GroupConvo = new(ModerationDefs_GroupConvo) return json.Unmarshal(b, t.ModerationDefs_GroupConvo) default: return nil } } // ModerationDefs_DirectConvo is a "directConvo" in the chat.bsky.moderation.defs schema. // // [NOTE: This is under active development and should be considered unstable while this note is here]. Data specific to a direct conversation, for moderation purposes. type ModerationDefs_DirectConvo struct { LexiconTypeID string `json:"$type" cborgen:"$type,const=chat.bsky.moderation.defs#directConvo"` } // ModerationDefs_GroupConvo is a "groupConvo" in the chat.bsky.moderation.defs schema. // // [NOTE: This is under active development and should be considered unstable while this note is here]. Data specific to a group conversation, for moderation purposes. Unlike chat.bsky.convo.defs#groupConvo, it does not include viewer-specific data (such as unreadJoinRequestCount), since the requester is a moderator and not a member of the conversation. type ModerationDefs_GroupConvo struct { LexiconTypeID string `json:"$type" cborgen:"$type,const=chat.bsky.moderation.defs#groupConvo"` CreatedAt string `json:"createdAt" cborgen:"createdAt"` JoinLink *GroupDefs_JoinLinkView `json:"joinLink,omitempty" cborgen:"joinLink,omitempty"` // joinRequestCount: The total number of pending join requests for the group conversation. This information is only visible to the owner and to moderators. Capped at 21. JoinRequestCount int64 `json:"joinRequestCount" cborgen:"joinRequestCount"` // lockStatus: The lock status of the conversation. LockStatus *string `json:"lockStatus" cborgen:"lockStatus"` // memberCount: The total number of members in the group conversation. MemberCount int64 `json:"memberCount" cborgen:"memberCount"` // memberLimit: The maximum number of members allowed in the group conversation. MemberLimit int64 `json:"memberLimit" cborgen:"memberLimit"` // name: The display name of the group conversation. Name string `json:"name" cborgen:"name"` }