// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package ozone

// schema: tools.ozone.moderation.queryEvents

import (
	"context"

	"github.com/bluesky-social/indigo/xrpc"
)

// ModerationQueryEvents_Output is the output of a tools.ozone.moderation.queryEvents call.
type ModerationQueryEvents_Output struct {
	Cursor *string                        `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	Events []*ModerationDefs_ModEventView `json:"events" cborgen:"events"`
}

// ModerationQueryEvents calls the XRPC method "tools.ozone.moderation.queryEvents".
//
// addedLabels: If specified, only events where all of these labels were added are returned
// addedTags: If specified, only events where all of these tags were added are returned
// comment: If specified, only events with comments containing the keyword are returned
// createdAfter: Retrieve events created after a given timestamp
// createdBefore: Retrieve events created before a given timestamp
// hasComment: If true, only events with comments are returned
// includeAllUserRecords: If true, events on all record types (posts, lists, profile etc.) owned by the did are returned
// removedLabels: If specified, only events where all of these labels were removed are returned
// removedTags: If specified, only events where all of these tags were removed are returned
// sortDirection: Sort direction for the events. Defaults to descending order of created at timestamp.
// 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.
func ModerationQueryEvents(ctx context.Context, c *xrpc.Client, addedLabels []string, addedTags []string, comment string, createdAfter string, createdBefore string, createdBy string, cursor string, hasComment bool, includeAllUserRecords bool, limit int64, removedLabels []string, removedTags []string, reportTypes []string, sortDirection string, subject string, types []string) (*ModerationQueryEvents_Output, error) {
	var out ModerationQueryEvents_Output

	params := map[string]interface{}{
		"addedLabels":           addedLabels,
		"addedTags":             addedTags,
		"comment":               comment,
		"createdAfter":          createdAfter,
		"createdBefore":         createdBefore,
		"createdBy":             createdBy,
		"cursor":                cursor,
		"hasComment":            hasComment,
		"includeAllUserRecords": includeAllUserRecords,
		"limit":                 limit,
		"removedLabels":         removedLabels,
		"removedTags":           removedTags,
		"reportTypes":           reportTypes,
		"sortDirection":         sortDirection,
		"subject":               subject,
		"types":                 types,
	}
	if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.moderation.queryEvents", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
