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

package tangled

// schema: sh.tangled.repo.getRepoByRepoDid

import (
	"context"

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

const (
	RepoGetRepoByRepoDidNSID = "sh.tangled.repo.getRepoByRepoDid"
)

// RepoGetRepoByRepoDid_Output is the output of a sh.tangled.repo.getRepoByRepoDid call.
type RepoGetRepoByRepoDid_Output struct {
	Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"`
	Uri string  `json:"uri" cborgen:"uri"`
	// value: Embedded sh.tangled.repo record.
	Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"`
}

// RepoGetRepoByRepoDid calls the XRPC method "sh.tangled.repo.getRepoByRepoDid".
//
// repoDid: Repo DID whose sh.tangled.repo record to fetch.
func RepoGetRepoByRepoDid(ctx context.Context, c util.LexClient, repoDid string) (*RepoGetRepoByRepoDid_Output, error) {
	var out RepoGetRepoByRepoDid_Output

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

	return &out, nil
}
