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

package tangled

// schema: sh.tangled.git.temp.getArchive

import (
	"bytes"
	"context"

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

const (
	GitTempGetArchiveNSID = "sh.tangled.git.temp.getArchive"
)

// GitTempGetArchive calls the XRPC method "sh.tangled.git.temp.getArchive".
//
// format: Archive format
// prefix: Prefix for files in the archive
// ref: Git reference (branch, tag, or commit SHA)
// repo: AT-URI of the repository
func GitTempGetArchive(ctx context.Context, c util.LexClient, format string, prefix string, ref string, repo string) ([]byte, error) {
	buf := new(bytes.Buffer)

	params := map[string]interface{}{}
	if format != "" {
		params["format"] = format
	}
	if prefix != "" {
		params["prefix"] = prefix
	}
	params["ref"] = ref
	params["repo"] = repo
	if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp.getArchive", params, nil, buf); err != nil {
		return nil, err
	}

	return buf.Bytes(), nil
}
