···17171818// ServerGetServiceAuth calls the XRPC method "com.atproto.server.getServiceAuth".
1919//
2020-// aud: The DID of the service that the token will be used to authenticate with
2020+// aud: The DID or `did#serviceId` reference of the service that the token will be used to authenticate with.
2121// exp: The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope.
2222// lxm: Lexicon (XRPC) method to bind the requested token to
2323func ServerGetServiceAuth(ctx context.Context, c lexutil.LexClient, aud string, exp int64, lxm string) (*ServerGetServiceAuth_Output, error) {
···48484949// EmbedExternal_ViewExternal is a "viewExternal" in the app.bsky.embed.external schema.
5050type EmbedExternal_ViewExternal struct {
5151+ // associatedProfiles: Profiles of the owners of the Atmosphere records that backed this view.
5252+ AssociatedProfiles []*ActorDefs_ProfileViewBasic `json:"associatedProfiles,omitempty" cborgen:"associatedProfiles,omitempty"`
5153 // associatedRefs: StrongRefs (uri+cid) of the Atmosphere records that backed this view.
5254 AssociatedRefs []*comatproto.RepoStrongRef `json:"associatedRefs,omitempty" cborgen:"associatedRefs,omitempty"`
5355 // createdAt: When the external content was created, if available. Example: a publication date, for an article.
···7274 // icon: Fully-qualified URL where an icon representing the source can be fetched. For example, CDN location provided by the App View.
7375 Icon *string `json:"icon,omitempty" cborgen:"icon,omitempty"`
7476 Theme *EmbedExternal_ViewExternalSourceTheme `json:"theme,omitempty" cborgen:"theme,omitempty"`
7575- Title *string `json:"title,omitempty" cborgen:"title,omitempty"`
7777+ Title string `json:"title" cborgen:"title"`
7678 // uri: URI of the source, if available. Example: the https:// URL of a site.standard.publication record.
7777- Uri *string `json:"uri,omitempty" cborgen:"uri,omitempty"`
7979+ Uri string `json:"uri" cborgen:"uri"`
7880}
79818082// EmbedExternal_ViewExternalSourceTheme is a "viewExternalSourceTheme" in the app.bsky.embed.external schema.
···1616 AssociatedRecords []*lexutil.LexiconTypeDecoder `json:"associatedRecords,omitempty" cborgen:"associatedRecords,omitempty"`
1717 // associatedRefs: StrongRefs (URI+CID) of the Atmosphere records that backed this view, suitable for embedding into a post's external.associatedRefs.
1818 AssociatedRefs []*comatproto.RepoStrongRef `json:"associatedRefs,omitempty" cborgen:"associatedRefs,omitempty"`
1919- // view: Hydrated view of the embed. Present whenever at least one record was hydrated. `view.external.title` and `view.external.description` may be empty strings when the resolved records didn't supply them; clients should treat that as 'no enrichment for this field.'
1919+ // view: Hydrated view of the embed. Present only when the resolved records back the requested URL and supply enough information to populate the required `viewExternal` fields. Omitted alongside the rest of the response when no records resolved or validation failed.
2020 View *EmbedExternal_View `json:"view,omitempty" cborgen:"view,omitempty"`
2121}
2222
···14141515// ConvoDefs_ConvoRef is a "convoRef" in the chat.bsky.convo.defs schema.
1616type ConvoDefs_ConvoRef struct {
1717- ConvoId string `json:"convoId" cborgen:"convoId"`
1818- Did string `json:"did" cborgen:"did"`
1717+ LexiconTypeID string `json:"$type" cborgen:"$type,const=chat.bsky.convo.defs#convoRef"`
1818+ ConvoId string `json:"convoId" cborgen:"convoId"`
1919+ Did string `json:"did" cborgen:"did"`
1920}
20212122// ConvoDefs_ConvoView is a "convoView" in the chat.bsky.convo.defs schema.
···174175 MemberLimit int64 `json:"memberLimit" cborgen:"memberLimit"`
175176 // name: The display name of the group conversation.
176177 Name string `json:"name" cborgen:"name"`
178178+ // unreadJoinRequestCount: The number of unread join requests for the group conversation. Only present for the owner.
179179+ UnreadJoinRequestCount *int64 `json:"unreadJoinRequestCount,omitempty" cborgen:"unreadJoinRequestCount,omitempty"`
177180}
178181179182// ConvoDefs_LogAcceptConvo is a "logAcceptConvo" in the chat.bsky.convo.defs schema.
···496499497500// ConvoDefs_LogOutgoingJoinRequest is a "logOutgoingJoinRequest" in the chat.bsky.convo.defs schema.
498501//
499499-// [NOTE: This is under active development and should be considered unstable while this note is here]. Event indicating a join request was made by the viewer.
502502+// [NOTE: This is under active development and should be considered unstable while this note is here]. Event indicating a join request was made by the requester. Only requester actor gets this.
500503type ConvoDefs_LogOutgoingJoinRequest struct {
501504 LexiconTypeID string `json:"$type" cborgen:"$type,const=chat.bsky.convo.defs#logOutgoingJoinRequest"`
502505 ConvoId string `json:"convoId" cborgen:"convoId"`
···556559 }
557560}
558561562562+// ConvoDefs_LogReadJoinRequests is a "logReadJoinRequests" in the chat.bsky.convo.defs schema.
563563+//
564564+// [NOTE: This is under active development and should be considered unstable while this note is here]. Event indicating the group owner marked join requests as read. Only the owner gets this.
565565+type ConvoDefs_LogReadJoinRequests struct {
566566+ LexiconTypeID string `json:"$type" cborgen:"$type,const=chat.bsky.convo.defs#logReadJoinRequests"`
567567+ ConvoId string `json:"convoId" cborgen:"convoId"`
568568+ Rev string `json:"rev" cborgen:"rev"`
569569+}
570570+559571// ConvoDefs_LogReadMessage is a "logReadMessage" in the chat.bsky.convo.defs schema.
560572//
561573// DEPRECATED: use logReadConvo instead. Event indicating a convo was read up to a certain message.
···703715 Rev string `json:"rev" cborgen:"rev"`
704716}
705717718718+// ConvoDefs_LogWithdrawIncomingJoinRequest is a "logWithdrawIncomingJoinRequest" in the chat.bsky.convo.defs schema.
719719+//
720720+// [NOTE: This is under active development and should be considered unstable while this note is here]. Event indicating a prospective member withdrew their join request. Only the owner gets this.
721721+type ConvoDefs_LogWithdrawIncomingJoinRequest struct {
722722+ LexiconTypeID string `json:"$type" cborgen:"$type,const=chat.bsky.convo.defs#logWithdrawIncomingJoinRequest"`
723723+ ConvoId string `json:"convoId" cborgen:"convoId"`
724724+ // member: Prospective member who withdrew their join request.
725725+ Member *ActorDefs_ProfileViewBasic `json:"member" cborgen:"member"`
726726+ Rev string `json:"rev" cborgen:"rev"`
727727+}
728728+729729+// ConvoDefs_LogWithdrawOutgoingJoinRequest is a "logWithdrawOutgoingJoinRequest" in the chat.bsky.convo.defs schema.
730730+//
731731+// [NOTE: This is under active development and should be considered unstable while this note is here]. Event indicating the viewer withdrew their own join request. Only requester actor gets this.
732732+type ConvoDefs_LogWithdrawOutgoingJoinRequest struct {
733733+ LexiconTypeID string `json:"$type" cborgen:"$type,const=chat.bsky.convo.defs#logWithdrawOutgoingJoinRequest"`
734734+ ConvoId string `json:"convoId" cborgen:"convoId"`
735735+ Rev string `json:"rev" cborgen:"rev"`
736736+}
737737+706738// ConvoDefs_MessageAndReactionView is a "messageAndReactionView" in the chat.bsky.convo.defs schema.
707739type ConvoDefs_MessageAndReactionView struct {
708740 LexiconTypeID string `json:"$type" cborgen:"$type,const=chat.bsky.convo.defs#messageAndReactionView"`
···719751}
720752721753type ConvoDefs_MessageInput_Embed struct {
722722- EmbedRecord *appbsky.EmbedRecord
754754+ EmbedRecord *appbsky.EmbedRecord
755755+ EmbedJoinLink *EmbedJoinLink
723756}
724757725758func (t *ConvoDefs_MessageInput_Embed) MarshalJSON() ([]byte, error) {
···727760 t.EmbedRecord.LexiconTypeID = "app.bsky.embed.record"
728761 return json.Marshal(t.EmbedRecord)
729762 }
763763+ if t.EmbedJoinLink != nil {
764764+ t.EmbedJoinLink.LexiconTypeID = "chat.bsky.embed.joinLink"
765765+ return json.Marshal(t.EmbedJoinLink)
766766+ }
730767 return nil, fmt.Errorf("can not marshal empty union as JSON")
731768}
732769···740777 case "app.bsky.embed.record":
741778 t.EmbedRecord = new(appbsky.EmbedRecord)
742779 return json.Unmarshal(b, t.EmbedRecord)
780780+ case "chat.bsky.embed.joinLink":
781781+ t.EmbedJoinLink = new(EmbedJoinLink)
782782+ return json.Unmarshal(b, t.EmbedJoinLink)
743783 default:
744784 return nil
745785 }
···774814}
775815776816type ConvoDefs_MessageView_Embed struct {
777777- EmbedRecord_View *appbsky.EmbedRecord_View
817817+ EmbedRecord_View *appbsky.EmbedRecord_View
818818+ EmbedJoinLink_View *EmbedJoinLink_View
778819}
779820780821func (t *ConvoDefs_MessageView_Embed) MarshalJSON() ([]byte, error) {
···782823 t.EmbedRecord_View.LexiconTypeID = "app.bsky.embed.record#view"
783824 return json.Marshal(t.EmbedRecord_View)
784825 }
826826+ if t.EmbedJoinLink_View != nil {
827827+ t.EmbedJoinLink_View.LexiconTypeID = "chat.bsky.embed.joinLink#view"
828828+ return json.Marshal(t.EmbedJoinLink_View)
829829+ }
785830 return nil, fmt.Errorf("can not marshal empty union as JSON")
786831}
787832···795840 case "app.bsky.embed.record#view":
796841 t.EmbedRecord_View = new(appbsky.EmbedRecord_View)
797842 return json.Unmarshal(b, t.EmbedRecord_View)
843843+ case "chat.bsky.embed.joinLink#view":
844844+ t.EmbedJoinLink_View = new(EmbedJoinLink_View)
845845+ return json.Unmarshal(b, t.EmbedJoinLink_View)
798846 default:
799847 return nil
800848 }
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+// Lexicon schema: chat.bsky.moderation.defs
44+55+package chat
66+77+import (
88+ "encoding/json"
99+ "fmt"
1010+1111+ lexutil "github.com/bluesky-social/indigo/lex/util"
1212+)
1313+1414+// ModerationDefs_ConvoView is a "convoView" in the chat.bsky.moderation.defs schema.
1515+//
1616+// [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.
1717+type ModerationDefs_ConvoView struct {
1818+ Id string `json:"id" cborgen:"id"`
1919+ // kind: Union field that has data specific to different kinds of convos.
2020+ Kind *ModerationDefs_ConvoView_Kind `json:"kind,omitempty" cborgen:"kind,omitempty"`
2121+ Rev string `json:"rev" cborgen:"rev"`
2222+}
2323+2424+// Union field that has data specific to different kinds of convos.
2525+type ModerationDefs_ConvoView_Kind struct {
2626+ ModerationDefs_DirectConvo *ModerationDefs_DirectConvo
2727+ ModerationDefs_GroupConvo *ModerationDefs_GroupConvo
2828+}
2929+3030+func (t *ModerationDefs_ConvoView_Kind) MarshalJSON() ([]byte, error) {
3131+ if t.ModerationDefs_DirectConvo != nil {
3232+ t.ModerationDefs_DirectConvo.LexiconTypeID = "chat.bsky.moderation.defs#directConvo"
3333+ return json.Marshal(t.ModerationDefs_DirectConvo)
3434+ }
3535+ if t.ModerationDefs_GroupConvo != nil {
3636+ t.ModerationDefs_GroupConvo.LexiconTypeID = "chat.bsky.moderation.defs#groupConvo"
3737+ return json.Marshal(t.ModerationDefs_GroupConvo)
3838+ }
3939+ return nil, fmt.Errorf("can not marshal empty union as JSON")
4040+}
4141+4242+func (t *ModerationDefs_ConvoView_Kind) UnmarshalJSON(b []byte) error {
4343+ typ, err := lexutil.TypeExtract(b)
4444+ if err != nil {
4545+ return err
4646+ }
4747+4848+ switch typ {
4949+ case "chat.bsky.moderation.defs#directConvo":
5050+ t.ModerationDefs_DirectConvo = new(ModerationDefs_DirectConvo)
5151+ return json.Unmarshal(b, t.ModerationDefs_DirectConvo)
5252+ case "chat.bsky.moderation.defs#groupConvo":
5353+ t.ModerationDefs_GroupConvo = new(ModerationDefs_GroupConvo)
5454+ return json.Unmarshal(b, t.ModerationDefs_GroupConvo)
5555+ default:
5656+ return nil
5757+ }
5858+}
5959+6060+// ModerationDefs_DirectConvo is a "directConvo" in the chat.bsky.moderation.defs schema.
6161+//
6262+// [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.
6363+type ModerationDefs_DirectConvo struct {
6464+ LexiconTypeID string `json:"$type" cborgen:"$type,const=chat.bsky.moderation.defs#directConvo"`
6565+}
6666+6767+// ModerationDefs_GroupConvo is a "groupConvo" in the chat.bsky.moderation.defs schema.
6868+//
6969+// [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.
7070+type ModerationDefs_GroupConvo struct {
7171+ LexiconTypeID string `json:"$type" cborgen:"$type,const=chat.bsky.moderation.defs#groupConvo"`
7272+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
7373+ JoinLink *GroupDefs_JoinLinkView `json:"joinLink,omitempty" cborgen:"joinLink,omitempty"`
7474+ // 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.
7575+ JoinRequestCount int64 `json:"joinRequestCount" cborgen:"joinRequestCount"`
7676+ // lockStatus: The lock status of the conversation.
7777+ LockStatus *string `json:"lockStatus" cborgen:"lockStatus"`
7878+ // memberCount: The total number of members in the group conversation.
7979+ MemberCount int64 `json:"memberCount" cborgen:"memberCount"`
8080+ // memberLimit: The maximum number of members allowed in the group conversation.
8181+ MemberLimit int64 `json:"memberLimit" cborgen:"memberLimit"`
8282+ // name: The display name of the group conversation.
8383+ Name string `json:"name" cborgen:"name"`
8484+}
···222222 // updateType: What changed.
223223 UpdateType string `json:"updateType" cborgen:"updateType"`
224224}
225225+226226+// ModerationSubscribeModEvents_EventRateLimitExceeded is a "eventRateLimitExceeded" in the chat.bsky.moderation.subscribeModEvents schema.
227227+//
228228+// Fired when a user exceeds a rate limit.
229229+type ModerationSubscribeModEvents_EventRateLimitExceeded struct {
230230+ // actorDid: The DID of the user who hit the rate limit.
231231+ ActorDid string `json:"actorDid" cborgen:"actorDid"`
232232+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
233233+ // endpoint: The NSID of the endpoint that was rate limited.
234234+ Endpoint string `json:"endpoint" cborgen:"endpoint"`
235235+ Rev string `json:"rev" cborgen:"rev"`
236236+}
···1818 CreatedBy string `json:"createdBy" cborgen:"createdBy"`
1919 Event *ModerationEmitEvent_Input_Event `json:"event" cborgen:"event"`
2020 // externalId: An optional external ID for the event, used to deduplicate events from external systems. Fails when an event of same type with the same external ID exists for the same subject.
2121- ExternalId *string `json:"externalId,omitempty" cborgen:"externalId,omitempty"`
2222- ModTool *ModerationDefs_ModTool `json:"modTool,omitempty" cborgen:"modTool,omitempty"`
2121+ ExternalId *string `json:"externalId,omitempty" cborgen:"externalId,omitempty"`
2222+ ModTool *ModerationDefs_ModTool `json:"modTool,omitempty" cborgen:"modTool,omitempty"`
2323+ // reportAction: Optional report-level targeting. If provided, this event will be linked to specific reports and reporters may be notified.
2424+ ReportAction *ModerationEmitEvent_ReportAction `json:"reportAction,omitempty" cborgen:"reportAction,omitempty"`
2325 Subject *ModerationEmitEvent_Input_Subject `json:"subject" cborgen:"subject"`
2426 SubjectBlobCids []string `json:"subjectBlobCids,omitempty" cborgen:"subjectBlobCids,omitempty"`
2527}
···276278 default:
277279 return nil
278280 }
281281+}
282282+283283+// ModerationEmitEvent_ReportAction is a "reportAction" in the tools.ozone.moderation.emitEvent schema.
284284+//
285285+// Target specific reports when emitting a moderation event
286286+type ModerationEmitEvent_ReportAction struct {
287287+ // all: Target ALL reports on the subject
288288+ All *bool `json:"all,omitempty" cborgen:"all,omitempty"`
289289+ // ids: Target specific report IDs
290290+ Ids []int64 `json:"ids,omitempty" cborgen:"ids,omitempty"`
291291+ // note: Note to send to reporter(s) when actioning their report
292292+ Note *string `json:"note,omitempty" cborgen:"note,omitempty"`
293293+ // types: Target reports matching these report types on the subject (fully qualified NSIDs)
294294+ Types []string `json:"types,omitempty" cborgen:"types,omitempty"`
279295}
280296281297// ModerationEmitEvent calls the XRPC method "tools.ozone.moderation.emitEvent".
···3232// removedLabels: If specified, only events where all of these labels were removed are returned
3333// removedTags: If specified, only events where all of these tags were removed are returned
3434// sortDirection: Sort direction for the events. Defaults to descending order of created at timestamp.
3535-// subjectType: If specified, only events where the subject is of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored.
3535+// subjectType: If specified, only events where the subject is of the given type (account, record, or conversation) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored.
3636// types: The types of events (fully qualified string in the format of tools.ozone.moderation.defs#modEvent<name>) to filter by. If not specified, all events are returned.
3737// withStrike: If specified, only events where strikeCount value is set are returned.
3838func ModerationQueryEvents(ctx context.Context, c lexutil.LexClient, addedLabels []string, addedTags []string, ageAssuranceState string, batchId string, collections []string, comment string, createdAfter string, createdBefore string, createdBy string, cursor string, hasComment bool, includeAllUserRecords bool, limit int64, modTool []string, policies []string, removedLabels []string, removedTags []string, reportTypes []string, sortDirection string, subject string, subjectType string, types []string, withStrike bool) (*ModerationQueryEvents_Output, error) {
···4545// reviewedAfter: Search subjects reviewed after a given timestamp
4646// reviewedBefore: Search subjects reviewed before a given timestamp
4747// subject: The subject to get the status for.
4848-// subjectType: If specified, subjects of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored.
4848+// subjectType: If specified, subjects of the given type (account, record, or conversation) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored.
4949// takendown: Get subjects that were taken down
5050func ModerationQueryStatuses(ctx context.Context, c lexutil.LexClient, ageAssuranceState string, appealed bool, collections []string, comment string, cursor string, excludeTags []string, hostingDeletedAfter string, hostingDeletedBefore string, hostingStatuses []string, hostingUpdatedAfter string, hostingUpdatedBefore string, ignoreSubjects []string, includeAllUserRecords bool, includeMuted bool, lastReviewedBy string, limit int64, minAccountSuspendCount int64, minPriorityScore int64, minReportedRecordsCount int64, minStrikeCount int64, minTakendownRecordsCount int64, onlyMuted bool, queueCount int64, queueIndex int64, queueSeed string, reportedAfter string, reportedBefore string, reviewState string, reviewedAfter string, reviewedBefore string, sortDirection string, sortField string, subject string, subjectType string, tags []string, takendown bool) (*ModerationQueryStatuses_Output, error) {
5151 var out ModerationQueryStatuses_Output
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+// Lexicon schema: tools.ozone.queue.assignModerator
44+55+package ozone
66+77+import (
88+ "context"
99+1010+ lexutil "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+// QueueAssignModerator_Input is the input argument to a tools.ozone.queue.assignModerator call.
1414+type QueueAssignModerator_Input struct {
1515+ // did: DID to be assigned.
1616+ Did string `json:"did" cborgen:"did"`
1717+ // queueId: The ID of the queue to assign the user to.
1818+ QueueId int64 `json:"queueId" cborgen:"queueId"`
1919+}
2020+2121+// QueueAssignModerator calls the XRPC method "tools.ozone.queue.assignModerator".
2222+func QueueAssignModerator(ctx context.Context, c lexutil.LexClient, input *QueueAssignModerator_Input) (*QueueDefs_AssignmentView, error) {
2323+ var out QueueDefs_AssignmentView
2424+ if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "tools.ozone.queue.assignModerator", nil, input, &out); err != nil {
2525+ return nil, err
2626+ }
2727+2828+ return &out, nil
2929+}
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+// Lexicon schema: tools.ozone.queue.defs
44+55+package ozone
66+77+// QueueDefs_AssignmentView is a "assignmentView" in the tools.ozone.queue.defs schema.
88+type QueueDefs_AssignmentView struct {
99+ Did string `json:"did" cborgen:"did"`
1010+ EndAt *string `json:"endAt,omitempty" cborgen:"endAt,omitempty"`
1111+ Id int64 `json:"id" cborgen:"id"`
1212+ // moderator: The moderator assigned to this queue
1313+ Moderator *TeamDefs_Member `json:"moderator,omitempty" cborgen:"moderator,omitempty"`
1414+ Queue *QueueDefs_QueueView `json:"queue" cborgen:"queue"`
1515+ StartAt string `json:"startAt" cborgen:"startAt"`
1616+}
1717+1818+// QueueDefs_QueueStats is a "queueStats" in the tools.ozone.queue.defs schema.
1919+type QueueDefs_QueueStats struct {
2020+ // actionRate: Percentage of reports actioned (actionedCount / inboundCount * 100), rounded to nearest integer. Absent when inboundCount is 0.
2121+ ActionRate *int64 `json:"actionRate,omitempty" cborgen:"actionRate,omitempty"`
2222+ // actionedCount: Number of reports in 'closed' status
2323+ ActionedCount *int64 `json:"actionedCount,omitempty" cborgen:"actionedCount,omitempty"`
2424+ // avgHandlingTimeSec: Average time in seconds from report creation to close, for reports closed in this period.
2525+ AvgHandlingTimeSec *int64 `json:"avgHandlingTimeSec,omitempty" cborgen:"avgHandlingTimeSec,omitempty"`
2626+ // escalatedCount: Number of reports in 'escalated' status
2727+ EscalatedCount *int64 `json:"escalatedCount,omitempty" cborgen:"escalatedCount,omitempty"`
2828+ // inboundCount: Reports received in this queue in the last 24 hours.
2929+ InboundCount *int64 `json:"inboundCount,omitempty" cborgen:"inboundCount,omitempty"`
3030+ // lastUpdated: When these statistics were last computed
3131+ LastUpdated *string `json:"lastUpdated,omitempty" cborgen:"lastUpdated,omitempty"`
3232+ // pendingCount: Number of reports in 'open' status
3333+ PendingCount *int64 `json:"pendingCount,omitempty" cborgen:"pendingCount,omitempty"`
3434+}
3535+3636+// QueueDefs_QueueView is a "queueView" in the tools.ozone.queue.defs schema.
3737+type QueueDefs_QueueView struct {
3838+ // collection: Collection name for record subjects (e.g., 'app.bsky.feed.post')
3939+ Collection *string `json:"collection,omitempty" cborgen:"collection,omitempty"`
4040+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
4141+ // createdBy: DID of moderator who created this queue
4242+ CreatedBy string `json:"createdBy" cborgen:"createdBy"`
4343+ // deletedAt: When the queue was deleted, if applicable
4444+ DeletedAt *string `json:"deletedAt,omitempty" cborgen:"deletedAt,omitempty"`
4545+ // description: Optional description of the queue
4646+ Description *string `json:"description,omitempty" cborgen:"description,omitempty"`
4747+ // enabled: Whether this queue is currently active
4848+ Enabled bool `json:"enabled" cborgen:"enabled"`
4949+ // id: Queue ID
5050+ Id int64 `json:"id" cborgen:"id"`
5151+ // name: Display name of the queue
5252+ Name string `json:"name" cborgen:"name"`
5353+ // reportTypes: Report reason types this queue accepts (fully qualified NSIDs)
5454+ ReportTypes []string `json:"reportTypes" cborgen:"reportTypes"`
5555+ // stats: Statistics about this queue
5656+ Stats *QueueDefs_QueueStats `json:"stats" cborgen:"stats"`
5757+ // subjectTypes: Subject types this queue accepts.
5858+ SubjectTypes []string `json:"subjectTypes" cborgen:"subjectTypes"`
5959+ UpdatedAt string `json:"updatedAt" cborgen:"updatedAt"`
6060+}
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+// Lexicon schema: tools.ozone.queue.deleteQueue
44+55+package ozone
66+77+import (
88+ "context"
99+1010+ lexutil "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+// QueueDeleteQueue_Input is the input argument to a tools.ozone.queue.deleteQueue call.
1414+type QueueDeleteQueue_Input struct {
1515+ // migrateToQueueId: Optional: migrate all reports to this queue. If not specified, reports will be set to unassigned (-1).
1616+ MigrateToQueueId *int64 `json:"migrateToQueueId,omitempty" cborgen:"migrateToQueueId,omitempty"`
1717+ // queueId: ID of the queue to delete
1818+ QueueId int64 `json:"queueId" cborgen:"queueId"`
1919+}
2020+2121+// QueueDeleteQueue_Output is the output of a tools.ozone.queue.deleteQueue call.
2222+type QueueDeleteQueue_Output struct {
2323+ Deleted bool `json:"deleted" cborgen:"deleted"`
2424+ // reportsMigrated: Number of reports that were migrated (if migration occurred)
2525+ ReportsMigrated *int64 `json:"reportsMigrated,omitempty" cborgen:"reportsMigrated,omitempty"`
2626+}
2727+2828+// QueueDeleteQueue calls the XRPC method "tools.ozone.queue.deleteQueue".
2929+func QueueDeleteQueue(ctx context.Context, c lexutil.LexClient, input *QueueDeleteQueue_Input) (*QueueDeleteQueue_Output, error) {
3030+ var out QueueDeleteQueue_Output
3131+ if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "tools.ozone.queue.deleteQueue", nil, input, &out); err != nil {
3232+ return nil, err
3333+ }
3434+3535+ return &out, nil
3636+}
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+// Lexicon schema: tools.ozone.queue.routeReports
44+55+package ozone
66+77+import (
88+ "context"
99+1010+ lexutil "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+// QueueRouteReports_Input is the input argument to a tools.ozone.queue.routeReports call.
1414+type QueueRouteReports_Input struct {
1515+ // endReportId: End of report ID range (inclusive). Difference between start and end must be less than 5,000.
1616+ EndReportId int64 `json:"endReportId" cborgen:"endReportId"`
1717+ // startReportId: Start of report ID range (inclusive).
1818+ StartReportId int64 `json:"startReportId" cborgen:"startReportId"`
1919+}
2020+2121+// QueueRouteReports_Output is the output of a tools.ozone.queue.routeReports call.
2222+type QueueRouteReports_Output struct {
2323+ // assigned: The number of reports assigned to a queue.
2424+ Assigned int64 `json:"assigned" cborgen:"assigned"`
2525+ // unmatched: The number of reports with no matching queue.
2626+ Unmatched int64 `json:"unmatched" cborgen:"unmatched"`
2727+}
2828+2929+// QueueRouteReports calls the XRPC method "tools.ozone.queue.routeReports".
3030+func QueueRouteReports(ctx context.Context, c lexutil.LexClient, input *QueueRouteReports_Input) (*QueueRouteReports_Output, error) {
3131+ var out QueueRouteReports_Output
3232+ if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "tools.ozone.queue.routeReports", nil, input, &out); err != nil {
3333+ return nil, err
3434+ }
3535+3636+ return &out, nil
3737+}
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+// Lexicon schema: tools.ozone.queue.unassignModerator
44+55+package ozone
66+77+import (
88+ "context"
99+1010+ lexutil "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+// QueueUnassignModerator_Input is the input argument to a tools.ozone.queue.unassignModerator call.
1414+type QueueUnassignModerator_Input struct {
1515+ // did: DID to be unassigned.
1616+ Did string `json:"did" cborgen:"did"`
1717+ // queueId: The ID of the queue to unassign the user from.
1818+ QueueId int64 `json:"queueId" cborgen:"queueId"`
1919+}
2020+2121+// QueueUnassignModerator calls the XRPC method "tools.ozone.queue.unassignModerator".
2222+func QueueUnassignModerator(ctx context.Context, c lexutil.LexClient, input *QueueUnassignModerator_Input) error {
2323+ if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "tools.ozone.queue.unassignModerator", nil, input, nil); err != nil {
2424+ return err
2525+ }
2626+2727+ return nil
2828+}
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+// Lexicon schema: tools.ozone.report.assignModerator
44+55+package ozone
66+77+import (
88+ "context"
99+1010+ lexutil "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+// ReportAssignModerator_Input is the input argument to a tools.ozone.report.assignModerator call.
1414+type ReportAssignModerator_Input struct {
1515+ // did: DID to be assigned. Defaults to the caller's DID. Admins may assign to any moderator.
1616+ Did *string `json:"did,omitempty" cborgen:"did,omitempty"`
1717+ // isPermanent: When true, the assignment has no expiry (endAt is null). Throws AlreadyAssigned if another user already has a permanent assignment on this report.
1818+ IsPermanent *bool `json:"isPermanent,omitempty" cborgen:"isPermanent,omitempty"`
1919+ // queueId: Optional queue ID to associate the assignment with. If not provided and the report has been assigned on a queue before, it will stay on that queue.
2020+ QueueId *int64 `json:"queueId,omitempty" cborgen:"queueId,omitempty"`
2121+ // reportId: The ID of the report to assign.
2222+ ReportId int64 `json:"reportId" cborgen:"reportId"`
2323+}
2424+2525+// ReportAssignModerator calls the XRPC method "tools.ozone.report.assignModerator".
2626+func ReportAssignModerator(ctx context.Context, c lexutil.LexClient, input *ReportAssignModerator_Input) (*ReportDefs_AssignmentView, error) {
2727+ var out ReportDefs_AssignmentView
2828+ if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "tools.ozone.report.assignModerator", nil, input, &out); err != nil {
2929+ return nil, err
3030+ }
3131+3232+ return &out, nil
3333+}
···33// Lexicon schema: tools.ozone.report.defs
4455package ozone
66+77+import (
88+ "encoding/json"
99+ "fmt"
1010+1111+ lexutil "github.com/bluesky-social/indigo/lex/util"
1212+)
1313+1414+// ReportDefs_AssignmentActivity is a "assignmentActivity" in the tools.ozone.report.defs schema.
1515+//
1616+// Activity recording a moderator being assigned to a report.
1717+type ReportDefs_AssignmentActivity struct {
1818+ LexiconTypeID string `json:"$type" cborgen:"$type,const=tools.ozone.report.defs#assignmentActivity"`
1919+ // previousStatus: The report's status before this activity. Populated automatically from the report row; not required in input.
2020+ PreviousStatus *string `json:"previousStatus,omitempty" cborgen:"previousStatus,omitempty"`
2121+}
2222+2323+// ReportDefs_AssignmentView is a "assignmentView" in the tools.ozone.report.defs schema.
2424+type ReportDefs_AssignmentView struct {
2525+ Did string `json:"did" cborgen:"did"`
2626+ EndAt *string `json:"endAt,omitempty" cborgen:"endAt,omitempty"`
2727+ Id int64 `json:"id" cborgen:"id"`
2828+ // moderator: The moderator assigned to this report
2929+ Moderator *TeamDefs_Member `json:"moderator,omitempty" cborgen:"moderator,omitempty"`
3030+ Queue *QueueDefs_QueueView `json:"queue,omitempty" cborgen:"queue,omitempty"`
3131+ ReportId int64 `json:"reportId" cborgen:"reportId"`
3232+ StartAt string `json:"startAt" cborgen:"startAt"`
3333+}
3434+3535+// ReportDefs_CloseActivity is a "closeActivity" in the tools.ozone.report.defs schema.
3636+//
3737+// Activity recording a report being closed.
3838+type ReportDefs_CloseActivity struct {
3939+ LexiconTypeID string `json:"$type" cborgen:"$type,const=tools.ozone.report.defs#closeActivity"`
4040+ // previousStatus: The report's status before this activity. Populated automatically from the report row; not required in input.
4141+ PreviousStatus *string `json:"previousStatus,omitempty" cborgen:"previousStatus,omitempty"`
4242+}
4343+4444+// ReportDefs_EscalationActivity is a "escalationActivity" in the tools.ozone.report.defs schema.
4545+//
4646+// Activity recording a report being escalated.
4747+type ReportDefs_EscalationActivity struct {
4848+ LexiconTypeID string `json:"$type" cborgen:"$type,const=tools.ozone.report.defs#escalationActivity"`
4949+ // previousStatus: The report's status before this activity. Populated automatically from the report row; not required in input.
5050+ PreviousStatus *string `json:"previousStatus,omitempty" cborgen:"previousStatus,omitempty"`
5151+}
5252+5353+// ReportDefs_HistoricalStats is a "historicalStats" in the tools.ozone.report.defs schema.
5454+//
5555+// A single daily snapshot of report statistics for a calendar date.
5656+type ReportDefs_HistoricalStats struct {
5757+ // actionRate: Percentage of reports actioned (actionedCount / inboundCount * 100), rounded to nearest integer.
5858+ ActionRate *int64 `json:"actionRate,omitempty" cborgen:"actionRate,omitempty"`
5959+ // actionedCount: Number of reports closed during this day.
6060+ ActionedCount *int64 `json:"actionedCount,omitempty" cborgen:"actionedCount,omitempty"`
6161+ // avgHandlingTimeSec: Average time in seconds from report creation (or moderator assignment) to close.
6262+ AvgHandlingTimeSec *int64 `json:"avgHandlingTimeSec,omitempty" cborgen:"avgHandlingTimeSec,omitempty"`
6363+ // computedAt: When this snapshot was last computed.
6464+ ComputedAt *string `json:"computedAt,omitempty" cborgen:"computedAt,omitempty"`
6565+ // date: The calendar date this snapshot covers (YYYY-MM-DD).
6666+ Date string `json:"date" cborgen:"date"`
6767+ // escalatedCount: Number of reports escalated during this day.
6868+ EscalatedCount *int64 `json:"escalatedCount,omitempty" cborgen:"escalatedCount,omitempty"`
6969+ // inboundCount: Reports received during this day.
7070+ InboundCount *int64 `json:"inboundCount,omitempty" cborgen:"inboundCount,omitempty"`
7171+ // pendingCount: Number of reports not closed at time of computation.
7272+ PendingCount *int64 `json:"pendingCount,omitempty" cborgen:"pendingCount,omitempty"`
7373+}
7474+7575+// ReportDefs_LiveStats is a "liveStats" in the tools.ozone.report.defs schema.
7676+//
7777+// Live statistics for reports for the current calendar day, filterable by queue, moderator, or report type.
7878+type ReportDefs_LiveStats struct {
7979+ // actionRate: Percentage of reports actioned (actionedCount / inboundCount * 100), rounded to nearest integer.
8080+ ActionRate *int64 `json:"actionRate,omitempty" cborgen:"actionRate,omitempty"`
8181+ // actionedCount: Number of reports closed today.
8282+ ActionedCount *int64 `json:"actionedCount,omitempty" cborgen:"actionedCount,omitempty"`
8383+ // avgHandlingTimeSec: Average time in seconds from report creation (or moderator assignment) to close.
8484+ AvgHandlingTimeSec *int64 `json:"avgHandlingTimeSec,omitempty" cborgen:"avgHandlingTimeSec,omitempty"`
8585+ // escalatedCount: Number of reports escalated today.
8686+ EscalatedCount *int64 `json:"escalatedCount,omitempty" cborgen:"escalatedCount,omitempty"`
8787+ // inboundCount: Reports received today.
8888+ InboundCount *int64 `json:"inboundCount,omitempty" cborgen:"inboundCount,omitempty"`
8989+ // lastUpdated: When these statistics were last computed.
9090+ LastUpdated *string `json:"lastUpdated,omitempty" cborgen:"lastUpdated,omitempty"`
9191+ // pendingCount: Number of reports currently not closed.
9292+ PendingCount *int64 `json:"pendingCount,omitempty" cborgen:"pendingCount,omitempty"`
9393+}
9494+9595+// ReportDefs_NoteActivity is a "noteActivity" in the tools.ozone.report.defs schema.
9696+//
9797+// Activity recording a note on a report. Use internalNote for moderator-only notes or publicNote for reporter-visible notes (or both).
9898+type ReportDefs_NoteActivity struct {
9999+ LexiconTypeID string `json:"$type" cborgen:"$type,const=tools.ozone.report.defs#noteActivity"`
100100+}
101101+102102+// ReportDefs_QueueActivity is a "queueActivity" in the tools.ozone.report.defs schema.
103103+//
104104+// Activity recording a report being routed to a queue.
105105+type ReportDefs_QueueActivity struct {
106106+ LexiconTypeID string `json:"$type" cborgen:"$type,const=tools.ozone.report.defs#queueActivity"`
107107+ // previousStatus: The report's status before this activity. Populated automatically from the report row; not required in input.
108108+ PreviousStatus *string `json:"previousStatus,omitempty" cborgen:"previousStatus,omitempty"`
109109+}
110110+111111+// ReportDefs_ReopenActivity is a "reopenActivity" in the tools.ozone.report.defs schema.
112112+//
113113+// Activity recording a closed report being reopened. Only valid when the report is in 'closed' status.
114114+type ReportDefs_ReopenActivity struct {
115115+ LexiconTypeID string `json:"$type" cborgen:"$type,const=tools.ozone.report.defs#reopenActivity"`
116116+ // previousStatus: The report's status before this activity. Populated automatically from the report row; not required in input.
117117+ PreviousStatus *string `json:"previousStatus,omitempty" cborgen:"previousStatus,omitempty"`
118118+}
119119+120120+// ReportDefs_ReportActivityView is a "reportActivityView" in the tools.ozone.report.defs schema.
121121+//
122122+// A single activity entry on a report.
123123+type ReportDefs_ReportActivityView struct {
124124+ // activity: The typed activity object describing what occurred.
125125+ Activity *ReportDefs_ReportActivityView_Activity `json:"activity" cborgen:"activity"`
126126+ // createdAt: When this activity was created
127127+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
128128+ // createdBy: DID of the actor who created this activity, or the service DID for automated activities.
129129+ CreatedBy string `json:"createdBy" cborgen:"createdBy"`
130130+ // id: Activity ID
131131+ Id int64 `json:"id" cborgen:"id"`
132132+ // internalNote: Optional moderator-only note. Not visible to reporters.
133133+ InternalNote *string `json:"internalNote,omitempty" cborgen:"internalNote,omitempty"`
134134+ // isAutomated: True if this activity was created by an automated process (e.g. queue router) rather than a direct human action.
135135+ IsAutomated bool `json:"isAutomated" cborgen:"isAutomated"`
136136+ // meta: Extensible JSON payload for loose activity-specific metadata (e.g. assignmentId).
137137+ Meta *interface{} `json:"meta,omitempty" cborgen:"meta,omitempty"`
138138+ // moderator: Full member record of the moderator who created this activity
139139+ Moderator *TeamDefs_Member `json:"moderator,omitempty" cborgen:"moderator,omitempty"`
140140+ // publicNote: Optional public note, potentially visible to the reporter.
141141+ PublicNote *string `json:"publicNote,omitempty" cborgen:"publicNote,omitempty"`
142142+ // reportId: ID of the report this activity belongs to
143143+ ReportId int64 `json:"reportId" cborgen:"reportId"`
144144+}
145145+146146+// The typed activity object describing what occurred.
147147+type ReportDefs_ReportActivityView_Activity struct {
148148+ ReportDefs_QueueActivity *ReportDefs_QueueActivity
149149+ ReportDefs_AssignmentActivity *ReportDefs_AssignmentActivity
150150+ ReportDefs_EscalationActivity *ReportDefs_EscalationActivity
151151+ ReportDefs_CloseActivity *ReportDefs_CloseActivity
152152+ ReportDefs_ReopenActivity *ReportDefs_ReopenActivity
153153+ ReportDefs_NoteActivity *ReportDefs_NoteActivity
154154+}
155155+156156+func (t *ReportDefs_ReportActivityView_Activity) MarshalJSON() ([]byte, error) {
157157+ if t.ReportDefs_QueueActivity != nil {
158158+ t.ReportDefs_QueueActivity.LexiconTypeID = "tools.ozone.report.defs#queueActivity"
159159+ return json.Marshal(t.ReportDefs_QueueActivity)
160160+ }
161161+ if t.ReportDefs_AssignmentActivity != nil {
162162+ t.ReportDefs_AssignmentActivity.LexiconTypeID = "tools.ozone.report.defs#assignmentActivity"
163163+ return json.Marshal(t.ReportDefs_AssignmentActivity)
164164+ }
165165+ if t.ReportDefs_EscalationActivity != nil {
166166+ t.ReportDefs_EscalationActivity.LexiconTypeID = "tools.ozone.report.defs#escalationActivity"
167167+ return json.Marshal(t.ReportDefs_EscalationActivity)
168168+ }
169169+ if t.ReportDefs_CloseActivity != nil {
170170+ t.ReportDefs_CloseActivity.LexiconTypeID = "tools.ozone.report.defs#closeActivity"
171171+ return json.Marshal(t.ReportDefs_CloseActivity)
172172+ }
173173+ if t.ReportDefs_ReopenActivity != nil {
174174+ t.ReportDefs_ReopenActivity.LexiconTypeID = "tools.ozone.report.defs#reopenActivity"
175175+ return json.Marshal(t.ReportDefs_ReopenActivity)
176176+ }
177177+ if t.ReportDefs_NoteActivity != nil {
178178+ t.ReportDefs_NoteActivity.LexiconTypeID = "tools.ozone.report.defs#noteActivity"
179179+ return json.Marshal(t.ReportDefs_NoteActivity)
180180+ }
181181+ return nil, fmt.Errorf("can not marshal empty union as JSON")
182182+}
183183+184184+func (t *ReportDefs_ReportActivityView_Activity) UnmarshalJSON(b []byte) error {
185185+ typ, err := lexutil.TypeExtract(b)
186186+ if err != nil {
187187+ return err
188188+ }
189189+190190+ switch typ {
191191+ case "tools.ozone.report.defs#queueActivity":
192192+ t.ReportDefs_QueueActivity = new(ReportDefs_QueueActivity)
193193+ return json.Unmarshal(b, t.ReportDefs_QueueActivity)
194194+ case "tools.ozone.report.defs#assignmentActivity":
195195+ t.ReportDefs_AssignmentActivity = new(ReportDefs_AssignmentActivity)
196196+ return json.Unmarshal(b, t.ReportDefs_AssignmentActivity)
197197+ case "tools.ozone.report.defs#escalationActivity":
198198+ t.ReportDefs_EscalationActivity = new(ReportDefs_EscalationActivity)
199199+ return json.Unmarshal(b, t.ReportDefs_EscalationActivity)
200200+ case "tools.ozone.report.defs#closeActivity":
201201+ t.ReportDefs_CloseActivity = new(ReportDefs_CloseActivity)
202202+ return json.Unmarshal(b, t.ReportDefs_CloseActivity)
203203+ case "tools.ozone.report.defs#reopenActivity":
204204+ t.ReportDefs_ReopenActivity = new(ReportDefs_ReopenActivity)
205205+ return json.Unmarshal(b, t.ReportDefs_ReopenActivity)
206206+ case "tools.ozone.report.defs#noteActivity":
207207+ t.ReportDefs_NoteActivity = new(ReportDefs_NoteActivity)
208208+ return json.Unmarshal(b, t.ReportDefs_NoteActivity)
209209+ default:
210210+ return nil
211211+ }
212212+}
213213+214214+// ReportDefs_ReportAssignment is a "reportAssignment" in the tools.ozone.report.defs schema.
215215+//
216216+// Information about the moderator currently assigned to a report.
217217+type ReportDefs_ReportAssignment struct {
218218+ // assignedAt: When the report was assigned
219219+ AssignedAt string `json:"assignedAt" cborgen:"assignedAt"`
220220+ // did: DID of the assigned moderator
221221+ Did string `json:"did" cborgen:"did"`
222222+ // moderator: Full member record of the assigned moderator
223223+ Moderator *TeamDefs_Member `json:"moderator,omitempty" cborgen:"moderator,omitempty"`
224224+}
225225+226226+// ReportDefs_ReportView is a "reportView" in the tools.ozone.report.defs schema.
227227+type ReportDefs_ReportView struct {
228228+ // actionEventIds: Array of moderation event IDs representing actions taken on this report (sorted DESC, most recent first)
229229+ ActionEventIds []int64 `json:"actionEventIds,omitempty" cborgen:"actionEventIds,omitempty"`
230230+ // actionNote: Note sent to reporter when report was actioned
231231+ ActionNote *string `json:"actionNote,omitempty" cborgen:"actionNote,omitempty"`
232232+ // actions: Optional: expanded action events
233233+ Actions []*ModerationDefs_ModEventView `json:"actions,omitempty" cborgen:"actions,omitempty"`
234234+ // assignment: Information about moderator currently assigned to this report (if any)
235235+ Assignment *ReportDefs_ReportAssignment `json:"assignment,omitempty" cborgen:"assignment,omitempty"`
236236+ // comment: Comment provided by the reporter
237237+ Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"`
238238+ // createdAt: When the report was created
239239+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
240240+ // eventId: ID of the moderation event that created this report
241241+ EventId int64 `json:"eventId" cborgen:"eventId"`
242242+ // id: Report ID
243243+ Id int64 `json:"id" cborgen:"id"`
244244+ // isMuted: Whether this report is muted. A report is muted if the reporter was muted or the subject was muted at the time the report was created.
245245+ IsMuted *bool `json:"isMuted,omitempty" cborgen:"isMuted,omitempty"`
246246+ // queue: The queue this report is assigned to (if any)
247247+ Queue *QueueDefs_QueueView `json:"queue,omitempty" cborgen:"queue,omitempty"`
248248+ // queuedAt: When the report was assigned to its current queue
249249+ QueuedAt *string `json:"queuedAt,omitempty" cborgen:"queuedAt,omitempty"`
250250+ // relatedReportCount: Number of other pending reports on the same subject
251251+ RelatedReportCount *int64 `json:"relatedReportCount,omitempty" cborgen:"relatedReportCount,omitempty"`
252252+ // reportType: Type of report
253253+ ReportType *string `json:"reportType" cborgen:"reportType"`
254254+ // reportedBy: DID of the user who made the report
255255+ ReportedBy string `json:"reportedBy" cborgen:"reportedBy"`
256256+ // reporter: Full subject view of the reporter account
257257+ Reporter *ModerationDefs_SubjectView `json:"reporter" cborgen:"reporter"`
258258+ // status: Current status of the report
259259+ Status string `json:"status" cborgen:"status"`
260260+ // subject: The subject that was reported with full details
261261+ Subject *ModerationDefs_SubjectView `json:"subject" cborgen:"subject"`
262262+ // subjectStatus: Current status of the reported subject
263263+ SubjectStatus *ModerationDefs_SubjectStatusView `json:"subjectStatus,omitempty" cborgen:"subjectStatus,omitempty"`
264264+ // updatedAt: When the report was last updated
265265+ UpdatedAt *string `json:"updatedAt,omitempty" cborgen:"updatedAt,omitempty"`
266266+}
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+// Lexicon schema: tools.ozone.report.queryReports
44+55+package ozone
66+77+import (
88+ "context"
99+1010+ lexutil "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+// ReportQueryReports_Output is the output of a tools.ozone.report.queryReports call.
1414+type ReportQueryReports_Output struct {
1515+ Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
1616+ Reports []*ReportDefs_ReportView `json:"reports" cborgen:"reports"`
1717+}
1818+1919+// ReportQueryReports calls the XRPC method "tools.ozone.report.queryReports".
2020+//
2121+// assignedTo: Filter by the DID of the moderator permanently assigned to the report.
2222+// collections: If specified, reports where the subject belongs to the given collections will be returned. When subjectType is set to 'account', this will be ignored.
2323+// did: Filter to reports where the subject is this DID or any record owned by this DID. Unlike `subject` (which scopes to a specific account or record), this returns all reports tied to the DID across both account-level and record-level subjects.
2424+// isMuted: Filter by muted status. true returns only muted reports, false returns only unmuted reports. Defaults to false.
2525+// queueId: Filter by queue ID. Use -1 for unassigned reports.
2626+// reportTypes: Filter by report types (fully qualified string in the format of com.atproto.moderation.defs#reason<name>).
2727+// reportedAfter: Retrieve reports created after a given timestamp
2828+// reportedBefore: Retrieve reports created before a given timestamp
2929+// status: Filter by report status.
3030+// subject: Filter by subject DID or AT-URI.
3131+// subjectType: If specified, reports of the given type (account or record) will be returned.
3232+func ReportQueryReports(ctx context.Context, c lexutil.LexClient, assignedTo string, collections []string, cursor string, did string, isMuted bool, limit int64, queueId int64, reportTypes []string, reportedAfter string, reportedBefore string, sortDirection string, sortField string, status string, subject string, subjectType string) (*ReportQueryReports_Output, error) {
3333+ var out ReportQueryReports_Output
3434+3535+ params := map[string]interface{}{}
3636+ if assignedTo != "" {
3737+ params["assignedTo"] = assignedTo
3838+ }
3939+ if len(collections) != 0 {
4040+ params["collections"] = collections
4141+ }
4242+ if cursor != "" {
4343+ params["cursor"] = cursor
4444+ }
4545+ if did != "" {
4646+ params["did"] = did
4747+ }
4848+ if isMuted {
4949+ params["isMuted"] = isMuted
5050+ }
5151+ if limit != 0 {
5252+ params["limit"] = limit
5353+ }
5454+ if queueId != 0 {
5555+ params["queueId"] = queueId
5656+ }
5757+ if len(reportTypes) != 0 {
5858+ params["reportTypes"] = reportTypes
5959+ }
6060+ if reportedAfter != "" {
6161+ params["reportedAfter"] = reportedAfter
6262+ }
6363+ if reportedBefore != "" {
6464+ params["reportedBefore"] = reportedBefore
6565+ }
6666+ if sortDirection != "" {
6767+ params["sortDirection"] = sortDirection
6868+ }
6969+ if sortField != "" {
7070+ params["sortField"] = sortField
7171+ }
7272+ params["status"] = status
7373+ if subject != "" {
7474+ params["subject"] = subject
7575+ }
7676+ if subjectType != "" {
7777+ params["subjectType"] = subjectType
7878+ }
7979+ if err := c.LexDo(ctx, lexutil.Query, "", "tools.ozone.report.queryReports", params, nil, &out); err != nil {
8080+ return nil, err
8181+ }
8282+8383+ return &out, nil
8484+}