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

package bsky

// schema: app.bsky.graph.getBlocks

import (
	"context"

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

// GraphGetBlocks_Output is the output of a app.bsky.graph.getBlocks call.
type GraphGetBlocks_Output struct {
	Blocks []*ActorDefs_ProfileView `json:"blocks" cborgen:"blocks"`
	Cursor *string                  `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
}

// GraphGetBlocks calls the XRPC method "app.bsky.graph.getBlocks".
func GraphGetBlocks(ctx context.Context, c util.LexClient, cursor string, limit int64) (*GraphGetBlocks_Output, error) {
	var out GraphGetBlocks_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.graph.getBlocks", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
