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

package atproto

// schema: com.atproto.admin.getInviteCodes

import (
	"context"

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

// AdminGetInviteCodes_Output is the output of a com.atproto.admin.getInviteCodes call.
type AdminGetInviteCodes_Output struct {
	Codes  []*ServerDefs_InviteCode `json:"codes" cborgen:"codes"`
	Cursor *string                  `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
}

// AdminGetInviteCodes calls the XRPC method "com.atproto.admin.getInviteCodes".
func AdminGetInviteCodes(ctx context.Context, c util.LexClient, cursor string, limit int64, sort string) (*AdminGetInviteCodes_Output, error) {
	var out AdminGetInviteCodes_Output

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

	return &out, nil
}
