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

package atproto

// schema: com.atproto.admin.searchAccounts

import (
	"context"

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

// AdminSearchAccounts_Output is the output of a com.atproto.admin.searchAccounts call.
type AdminSearchAccounts_Output struct {
	Accounts []*AdminDefs_AccountView `json:"accounts" cborgen:"accounts"`
	Cursor   *string                  `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
}

// AdminSearchAccounts calls the XRPC method "com.atproto.admin.searchAccounts".
func AdminSearchAccounts(ctx context.Context, c *xrpc.Client, cursor string, email string, limit int64) (*AdminSearchAccounts_Output, error) {
	var out AdminSearchAccounts_Output

	params := map[string]interface{}{
		"cursor": cursor,
		"email":  email,
		"limit":  limit,
	}
	if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.searchAccounts", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
