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

package bsky

// schema: app.bsky.feed.getRepostedBy

import (
	"context"

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

// FeedGetRepostedBy_Output is the output of a app.bsky.feed.getRepostedBy call.
type FeedGetRepostedBy_Output struct {
	Cid        *string                  `json:"cid,omitempty" cborgen:"cid,omitempty"`
	Cursor     *string                  `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	RepostedBy []*ActorDefs_ProfileView `json:"repostedBy" cborgen:"repostedBy"`
	Uri        string                   `json:"uri" cborgen:"uri"`
}

// FeedGetRepostedBy calls the XRPC method "app.bsky.feed.getRepostedBy".
//
// cid: If supplied, filters to reposts of specific version (by CID) of the post record.
// uri: Reference (AT-URI) of post record
func FeedGetRepostedBy(ctx context.Context, c util.LexClient, cid string, cursor string, limit int64, uri string) (*FeedGetRepostedBy_Output, error) {
	var out FeedGetRepostedBy_Output

	params := map[string]interface{}{}
	if cid != "" {
		params["cid"] = cid
	}
	if cursor != "" {
		params["cursor"] = cursor
	}
	if limit != 0 {
		params["limit"] = limit
	}
	params["uri"] = uri
	if err := c.LexDo(ctx, util.Query, "", "app.bsky.feed.getRepostedBy", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
