1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package atproto
4
5// schema: com.atproto.admin.getInviteCodes
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13// AdminGetInviteCodes_Output is the output of a com.atproto.admin.getInviteCodes call.
14type AdminGetInviteCodes_Output struct {
15 Codes []*ServerDefs_InviteCode `json:"codes" cborgen:"codes"`
16 Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
17}
18
19// AdminGetInviteCodes calls the XRPC method "com.atproto.admin.getInviteCodes".
20func AdminGetInviteCodes(ctx context.Context, c util.LexClient, cursor string, limit int64, sort string) (*AdminGetInviteCodes_Output, error) {
21 var out AdminGetInviteCodes_Output
22
23 params := map[string]interface{}{}
24 if cursor != "" {
25 params["cursor"] = cursor
26 }
27 if limit != 0 {
28 params["limit"] = limit
29 }
30 if sort != "" {
31 params["sort"] = sort
32 }
33 if err := c.LexDo(ctx, util.Query, "", "com.atproto.admin.getInviteCodes", params, nil, &out); err != nil {
34 return nil, err
35 }
36
37 return &out, nil
38}