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

package org_tangled

// schema: org.tangled.temp.migrator.listTasks

import (
	"context"

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

const (
	TempMigratorListTasksNSID = "org.tangled.temp.migrator.listTasks"
)

// TempMigratorListTasks_Output is the output of a org.tangled.temp.migrator.listTasks call.
type TempMigratorListTasks_Output struct {
	Tasks []*TempMigratorDefs_Task `json:"tasks" cborgen:"tasks"`
}

// TempMigratorListTasks calls the XRPC method "org.tangled.temp.migrator.listTasks".
//
// limit: Maximum number of tasks to return.
func TempMigratorListTasks(ctx context.Context, c util.LexClient, limit int64) (*TempMigratorListTasks_Output, error) {
	var out TempMigratorListTasks_Output

	params := map[string]interface{}{}
	if limit != 0 {
		params["limit"] = limit
	}
	if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.migrator.listTasks", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
