1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package ozone
4
5// schema: tools.ozone.moderation.queryEvents
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13// ModerationQueryEvents_Output is the output of a tools.ozone.moderation.queryEvents call.
14type ModerationQueryEvents_Output struct {
15 Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
16 Events []*ModerationDefs_ModEventView `json:"events" cborgen:"events"`
17}
18
19// ModerationQueryEvents calls the XRPC method "tools.ozone.moderation.queryEvents".
20//
21// addedLabels: If specified, only events where all of these labels were added are returned
22// addedTags: If specified, only events where all of these tags were added are returned
23// ageAssuranceState: If specified, only events where the age assurance state matches the given value are returned
24// collections: If specified, only events where the subject belongs to the given collections will be returned. When subjectType is set to 'account', this will be ignored.
25// comment: If specified, only events with comments containing the keyword are returned. Apply || separator to use multiple keywords and match using OR condition.
26// createdAfter: Retrieve events created after a given timestamp
27// createdBefore: Retrieve events created before a given timestamp
28// hasComment: If true, only events with comments are returned
29// includeAllUserRecords: If true, events on all record types (posts, lists, profile etc.) or records from given 'collections' param, owned by the did are returned.
30// modTool: If specified, only events where the modTool name matches any of the given values are returned
31// removedLabels: If specified, only events where all of these labels were removed are returned
32// removedTags: If specified, only events where all of these tags were removed are returned
33// sortDirection: Sort direction for the events. Defaults to descending order of created at timestamp.
34// 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.
35// 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.
36func ModerationQueryEvents(ctx context.Context, c util.LexClient, addedLabels []string, addedTags []string, ageAssuranceState 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) (*ModerationQueryEvents_Output, error) {
37 var out ModerationQueryEvents_Output
38
39 params := map[string]interface{}{}
40 if len(addedLabels) != 0 {
41 params["addedLabels"] = addedLabels
42 }
43 if len(addedTags) != 0 {
44 params["addedTags"] = addedTags
45 }
46 if ageAssuranceState != "" {
47 params["ageAssuranceState"] = ageAssuranceState
48 }
49 if len(collections) != 0 {
50 params["collections"] = collections
51 }
52 if comment != "" {
53 params["comment"] = comment
54 }
55 if createdAfter != "" {
56 params["createdAfter"] = createdAfter
57 }
58 if createdBefore != "" {
59 params["createdBefore"] = createdBefore
60 }
61 if createdBy != "" {
62 params["createdBy"] = createdBy
63 }
64 if cursor != "" {
65 params["cursor"] = cursor
66 }
67 if hasComment {
68 params["hasComment"] = hasComment
69 }
70 if includeAllUserRecords {
71 params["includeAllUserRecords"] = includeAllUserRecords
72 }
73 if limit != 0 {
74 params["limit"] = limit
75 }
76 if len(modTool) != 0 {
77 params["modTool"] = modTool
78 }
79 if len(policies) != 0 {
80 params["policies"] = policies
81 }
82 if len(removedLabels) != 0 {
83 params["removedLabels"] = removedLabels
84 }
85 if len(removedTags) != 0 {
86 params["removedTags"] = removedTags
87 }
88 if len(reportTypes) != 0 {
89 params["reportTypes"] = reportTypes
90 }
91 if sortDirection != "" {
92 params["sortDirection"] = sortDirection
93 }
94 if subject != "" {
95 params["subject"] = subject
96 }
97 if subjectType != "" {
98 params["subjectType"] = subjectType
99 }
100 if len(types) != 0 {
101 params["types"] = types
102 }
103 if err := c.LexDo(ctx, util.Query, "", "tools.ozone.moderation.queryEvents", params, nil, &out); err != nil {
104 return nil, err
105 }
106
107 return &out, nil
108}