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

package bsky

// schema: app.bsky.bookmark.getBookmarks

import (
	"context"

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

// BookmarkGetBookmarks_Output is the output of a app.bsky.bookmark.getBookmarks call.
type BookmarkGetBookmarks_Output struct {
	Bookmarks []*BookmarkDefs_BookmarkView `json:"bookmarks" cborgen:"bookmarks"`
	Cursor    *string                      `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
}

// BookmarkGetBookmarks calls the XRPC method "app.bsky.bookmark.getBookmarks".
func BookmarkGetBookmarks(ctx context.Context, c util.LexClient, cursor string, limit int64) (*BookmarkGetBookmarks_Output, error) {
	var out BookmarkGetBookmarks_Output

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

	return &out, nil
}
