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

package bsky

// schema: app.bsky.graph.getList

import (
	"context"

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

// GraphGetList_Output is the output of a app.bsky.graph.getList call.
type GraphGetList_Output struct {
	Cursor *string                   `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	Items  []*GraphDefs_ListItemView `json:"items" cborgen:"items"`
	List   *GraphDefs_ListView       `json:"list" cborgen:"list"`
}

// GraphGetList calls the XRPC method "app.bsky.graph.getList".
//
// list: Reference (AT-URI) of the list record to hydrate.
func GraphGetList(ctx context.Context, c util.LexClient, cursor string, limit int64, list string) (*GraphGetList_Output, error) {
	var out GraphGetList_Output

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

	return &out, nil
}
