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

package chat

// schema: chat.bsky.convo.listConvos

import (
	"context"

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

// ConvoListConvos_Output is the output of a chat.bsky.convo.listConvos call.
type ConvoListConvos_Output struct {
	Convos []*ConvoDefs_ConvoView `json:"convos" cborgen:"convos"`
	Cursor *string                `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
}

// ConvoListConvos calls the XRPC method "chat.bsky.convo.listConvos".
func ConvoListConvos(ctx context.Context, c util.LexClient, cursor string, limit int64, readState string, status string) (*ConvoListConvos_Output, error) {
	var out ConvoListConvos_Output

	params := map[string]interface{}{}
	if cursor != "" {
		params["cursor"] = cursor
	}
	if limit != 0 {
		params["limit"] = limit
	}
	if readState != "" {
		params["readState"] = readState
	}
	if status != "" {
		params["status"] = status
	}
	if err := c.LexDo(ctx, util.Query, "", "chat.bsky.convo.listConvos", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
