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

package atproto

// schema: com.atproto.server.getAccountInviteCodes

import (
	"context"

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

// ServerGetAccountInviteCodes_Output is the output of a com.atproto.server.getAccountInviteCodes call.
type ServerGetAccountInviteCodes_Output struct {
	Codes []*ServerDefs_InviteCode `json:"codes" cborgen:"codes"`
}

// ServerGetAccountInviteCodes calls the XRPC method "com.atproto.server.getAccountInviteCodes".
//
// createAvailable: Controls whether any new 'earned' but not 'created' invites should be created.
func ServerGetAccountInviteCodes(ctx context.Context, c util.LexClient, createAvailable bool, includeUsed bool) (*ServerGetAccountInviteCodes_Output, error) {
	var out ServerGetAccountInviteCodes_Output

	params := map[string]interface{}{}
	if createAvailable {
		params["createAvailable"] = createAvailable
	}
	if includeUsed {
		params["includeUsed"] = includeUsed
	}
	if err := c.LexDo(ctx, util.Query, "", "com.atproto.server.getAccountInviteCodes", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
