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

package bsky

// schema: app.bsky.unspecced.searchStarterPacksSkeleton

import (
	"context"

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

// UnspeccedSearchStarterPacksSkeleton_Output is the output of a app.bsky.unspecced.searchStarterPacksSkeleton call.
type UnspeccedSearchStarterPacksSkeleton_Output struct {
	Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	// hitsTotal: Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits.
	HitsTotal    *int64                                     `json:"hitsTotal,omitempty" cborgen:"hitsTotal,omitempty"`
	StarterPacks []*UnspeccedDefs_SkeletonSearchStarterPack `json:"starterPacks" cborgen:"starterPacks"`
}

// UnspeccedSearchStarterPacksSkeleton calls the XRPC method "app.bsky.unspecced.searchStarterPacksSkeleton".
//
// cursor: Optional pagination mechanism; may not necessarily allow scrolling through entire result set.
// q: Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended.
// viewer: DID of the account making the request (not included for public/unauthenticated queries).
func UnspeccedSearchStarterPacksSkeleton(ctx context.Context, c util.LexClient, cursor string, limit int64, q string, viewer string) (*UnspeccedSearchStarterPacksSkeleton_Output, error) {
	var out UnspeccedSearchStarterPacksSkeleton_Output

	params := map[string]interface{}{}
	if cursor != "" {
		params["cursor"] = cursor
	}
	if limit != 0 {
		params["limit"] = limit
	}
	params["q"] = q
	if viewer != "" {
		params["viewer"] = viewer
	}
	if err := c.LexDo(ctx, util.Query, "", "app.bsky.unspecced.searchStarterPacksSkeleton", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
