// 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/xrpc"
)

// 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 *xrpc.Client, createAvailable bool, includeUsed bool) (*ServerGetAccountInviteCodes_Output, error) {
	var out ServerGetAccountInviteCodes_Output

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

	return &out, nil
}
