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

package tangled

// schema: sh.tangled.repo.getIssues

import (
	"context"

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

const (
	RepoGetIssuesNSID = "sh.tangled.repo.getIssues"
)

// RepoGetIssues_Output is the output of a sh.tangled.repo.getIssues call.
type RepoGetIssues_Output struct {
	Items []*RepoGetIssues_RecordView `json:"items" cborgen:"items"`
}

// RepoGetIssues_RecordView is a "recordView" in the sh.tangled.repo.getIssues schema.
type RepoGetIssues_RecordView struct {
	Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"`
	Uri string  `json:"uri" cborgen:"uri"`
	// value: Embedded sh.tangled.repo.issue record.
	Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"`
}

// RepoGetIssues calls the XRPC method "sh.tangled.repo.getIssues".
//
// issues: AT-URIs of the sh.tangled.repo.issue records to fetch. At most 50 per request.
func RepoGetIssues(ctx context.Context, c util.LexClient, issues []string) (*RepoGetIssues_Output, error) {
	var out RepoGetIssues_Output

	params := map[string]interface{}{}
	params["issues"] = issues
	if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.getIssues", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
