this repo has no description
at new_linear_stuff 100 lines 4.1 kB view raw
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// 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. 24// comment: If specified, only events with comments containing the keyword are returned. Apply || separator to use multiple keywords and match using OR condition. 25// createdAfter: Retrieve events created after a given timestamp 26// createdBefore: Retrieve events created before a given timestamp 27// hasComment: If true, only events with comments are returned 28// includeAllUserRecords: If true, events on all record types (posts, lists, profile etc.) or records from given 'collections' param, owned by the did are returned. 29// removedLabels: If specified, only events where all of these labels were removed are returned 30// removedTags: If specified, only events where all of these tags were removed are returned 31// sortDirection: Sort direction for the events. Defaults to descending order of created at timestamp. 32// 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. 33// 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. 34func ModerationQueryEvents(ctx context.Context, c util.LexClient, addedLabels []string, addedTags []string, collections []string, comment string, createdAfter string, createdBefore string, createdBy string, cursor string, hasComment bool, includeAllUserRecords bool, limit int64, policies []string, removedLabels []string, removedTags []string, reportTypes []string, sortDirection string, subject string, subjectType string, types []string) (*ModerationQueryEvents_Output, error) { 35 var out ModerationQueryEvents_Output 36 37 params := map[string]interface{}{} 38 if len(addedLabels) != 0 { 39 params["addedLabels"] = addedLabels 40 } 41 if len(addedTags) != 0 { 42 params["addedTags"] = addedTags 43 } 44 if len(collections) != 0 { 45 params["collections"] = collections 46 } 47 if comment != "" { 48 params["comment"] = comment 49 } 50 if createdAfter != "" { 51 params["createdAfter"] = createdAfter 52 } 53 if createdBefore != "" { 54 params["createdBefore"] = createdBefore 55 } 56 if createdBy != "" { 57 params["createdBy"] = createdBy 58 } 59 if cursor != "" { 60 params["cursor"] = cursor 61 } 62 if hasComment { 63 params["hasComment"] = hasComment 64 } 65 if includeAllUserRecords { 66 params["includeAllUserRecords"] = includeAllUserRecords 67 } 68 if limit != 0 { 69 params["limit"] = limit 70 } 71 if len(policies) != 0 { 72 params["policies"] = policies 73 } 74 if len(removedLabels) != 0 { 75 params["removedLabels"] = removedLabels 76 } 77 if len(removedTags) != 0 { 78 params["removedTags"] = removedTags 79 } 80 if len(reportTypes) != 0 { 81 params["reportTypes"] = reportTypes 82 } 83 if sortDirection != "" { 84 params["sortDirection"] = sortDirection 85 } 86 if subject != "" { 87 params["subject"] = subject 88 } 89 if subjectType != "" { 90 params["subjectType"] = subjectType 91 } 92 if len(types) != 0 { 93 params["types"] = types 94 } 95 if err := c.LexDo(ctx, util.Query, "", "tools.ozone.moderation.queryEvents", params, nil, &out); err != nil { 96 return nil, err 97 } 98 99 return &out, nil 100}