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

package ozone

// schema: tools.ozone.safelink.queryRules

import (
	"context"

	"github.com/bluesky-social/indigo/lex/util"
)

// SafelinkQueryRules_Input is the input argument to a tools.ozone.safelink.queryRules call.
type SafelinkQueryRules_Input struct {
	// actions: Filter by action types
	Actions []string `json:"actions,omitempty" cborgen:"actions,omitempty"`
	// createdBy: Filter by rule creator
	CreatedBy *string `json:"createdBy,omitempty" cborgen:"createdBy,omitempty"`
	// cursor: Cursor for pagination
	Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	// limit: Maximum number of results to return
	Limit *int64 `json:"limit,omitempty" cborgen:"limit,omitempty"`
	// patternType: Filter by pattern type
	PatternType *string `json:"patternType,omitempty" cborgen:"patternType,omitempty"`
	// reason: Filter by reason type
	Reason *string `json:"reason,omitempty" cborgen:"reason,omitempty"`
	// sortDirection: Sort direction
	SortDirection *string `json:"sortDirection,omitempty" cborgen:"sortDirection,omitempty"`
	// urls: Filter by specific URLs or domains
	Urls []string `json:"urls,omitempty" cborgen:"urls,omitempty"`
}

// SafelinkQueryRules_Output is the output of a tools.ozone.safelink.queryRules call.
type SafelinkQueryRules_Output struct {
	// cursor: Next cursor for pagination. Only present if there are more results.
	Cursor *string                 `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	Rules  []*SafelinkDefs_UrlRule `json:"rules" cborgen:"rules"`
}

// SafelinkQueryRules calls the XRPC method "tools.ozone.safelink.queryRules".
func SafelinkQueryRules(ctx context.Context, c util.LexClient, input *SafelinkQueryRules_Input) (*SafelinkQueryRules_Output, error) {
	var out SafelinkQueryRules_Output
	if err := c.LexDo(ctx, util.Procedure, "application/json", "tools.ozone.safelink.queryRules", nil, input, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
