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

package atproto

// schema: com.atproto.sync.listReposByCollection

import (
	"context"

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

// SyncListReposByCollection_Output is the output of a com.atproto.sync.listReposByCollection call.
type SyncListReposByCollection_Output struct {
	Cursor *string                           `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	Repos  []*SyncListReposByCollection_Repo `json:"repos" cborgen:"repos"`
}

// SyncListReposByCollection_Repo is a "repo" in the com.atproto.sync.listReposByCollection schema.
type SyncListReposByCollection_Repo struct {
	Did string `json:"did" cborgen:"did"`
}

// SyncListReposByCollection calls the XRPC method "com.atproto.sync.listReposByCollection".
//
// limit: Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists.
func SyncListReposByCollection(ctx context.Context, c util.LexClient, collection string, cursor string, limit int64) (*SyncListReposByCollection_Output, error) {
	var out SyncListReposByCollection_Output

	params := map[string]interface{}{}
	params["collection"] = collection
	if cursor != "" {
		params["cursor"] = cursor
	}
	if limit != 0 {
		params["limit"] = limit
	}
	if err := c.LexDo(ctx, util.Query, "", "com.atproto.sync.listReposByCollection", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
