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

package ozone

// schema: tools.ozone.set.querySets

import (
	"context"

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

// SetQuerySets_Output is the output of a tools.ozone.set.querySets call.
type SetQuerySets_Output struct {
	Cursor *string            `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	Sets   []*SetDefs_SetView `json:"sets" cborgen:"sets"`
}

// SetQuerySets calls the XRPC method "tools.ozone.set.querySets".
//
// sortDirection: Defaults to ascending order of name field.
func SetQuerySets(ctx context.Context, c util.LexClient, cursor string, limit int64, namePrefix string, sortBy string, sortDirection string) (*SetQuerySets_Output, error) {
	var out SetQuerySets_Output

	params := map[string]interface{}{}
	if cursor != "" {
		params["cursor"] = cursor
	}
	if limit != 0 {
		params["limit"] = limit
	}
	if namePrefix != "" {
		params["namePrefix"] = namePrefix
	}
	if sortBy != "" {
		params["sortBy"] = sortBy
	}
	if sortDirection != "" {
		params["sortDirection"] = sortDirection
	}
	if err := c.LexDo(ctx, util.Query, "", "tools.ozone.set.querySets", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
