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

package bsky

// schema: app.bsky.graph.getLists

import (
	"context"

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

// GraphGetLists_Output is the output of a app.bsky.graph.getLists call.
type GraphGetLists_Output struct {
	Cursor *string               `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	Lists  []*GraphDefs_ListView `json:"lists" cborgen:"lists"`
}

// GraphGetLists calls the XRPC method "app.bsky.graph.getLists".
//
// actor: The account (actor) to enumerate lists from.
// purposes: Optional filter by list purpose. If not specified, all supported types are returned.
func GraphGetLists(ctx context.Context, c util.LexClient, actor string, cursor string, limit int64, purposes []string) (*GraphGetLists_Output, error) {
	var out GraphGetLists_Output

	params := map[string]interface{}{}
	params["actor"] = actor
	if cursor != "" {
		params["cursor"] = cursor
	}
	if limit != 0 {
		params["limit"] = limit
	}
	if len(purposes) != 0 {
		params["purposes"] = purposes
	}
	if err := c.LexDo(ctx, util.Query, "", "app.bsky.graph.getLists", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
