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

package ozone

// schema: tools.ozone.moderation.searchRepos

import (
	"context"

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

// ModerationSearchRepos_Output is the output of a tools.ozone.moderation.searchRepos call.
type ModerationSearchRepos_Output struct {
	Cursor *string                    `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	Repos  []*ModerationDefs_RepoView `json:"repos" cborgen:"repos"`
}

// ModerationSearchRepos calls the XRPC method "tools.ozone.moderation.searchRepos".
//
// term: DEPRECATED: use 'q' instead
func ModerationSearchRepos(ctx context.Context, c util.LexClient, cursor string, limit int64, q string, term string) (*ModerationSearchRepos_Output, error) {
	var out ModerationSearchRepos_Output

	params := map[string]interface{}{}
	if cursor != "" {
		params["cursor"] = cursor
	}
	if limit != 0 {
		params["limit"] = limit
	}
	if q != "" {
		params["q"] = q
	}
	if term != "" {
		params["term"] = term
	}
	if err := c.LexDo(ctx, util.Query, "", "tools.ozone.moderation.searchRepos", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
