fork of indigo with slightly nicer lexgen
at main 2.8 kB view raw
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 3package bsky 4 5// schema: app.bsky.notification.listNotifications 6 7import ( 8 "context" 9 10 comatprototypes "github.com/bluesky-social/indigo/api/atproto" 11 "github.com/bluesky-social/indigo/lex/util" 12) 13 14// NotificationListNotifications_Notification is a "notification" in the app.bsky.notification.listNotifications schema. 15type NotificationListNotifications_Notification struct { 16 Author *ActorDefs_ProfileView `json:"author" cborgen:"author"` 17 Cid string `json:"cid" cborgen:"cid"` 18 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 19 IsRead bool `json:"isRead" cborgen:"isRead"` 20 Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 21 // reason: The reason why this notification was delivered - e.g. your post was liked, or you received a new follower. 22 Reason string `json:"reason" cborgen:"reason"` 23 ReasonSubject *string `json:"reasonSubject,omitempty" cborgen:"reasonSubject,omitempty"` 24 Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` 25 Uri string `json:"uri" cborgen:"uri"` 26} 27 28// NotificationListNotifications_Output is the output of a app.bsky.notification.listNotifications call. 29type NotificationListNotifications_Output struct { 30 Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 31 Notifications []*NotificationListNotifications_Notification `json:"notifications" cborgen:"notifications"` 32 Priority *bool `json:"priority,omitempty" cborgen:"priority,omitempty"` 33 SeenAt *string `json:"seenAt,omitempty" cborgen:"seenAt,omitempty"` 34} 35 36// NotificationListNotifications calls the XRPC method "app.bsky.notification.listNotifications". 37// 38// reasons: Notification reasons to include in response. 39func NotificationListNotifications(ctx context.Context, c util.LexClient, cursor string, limit int64, priority bool, reasons []string, seenAt string) (*NotificationListNotifications_Output, error) { 40 var out NotificationListNotifications_Output 41 42 params := map[string]interface{}{} 43 if cursor != "" { 44 params["cursor"] = cursor 45 } 46 if limit != 0 { 47 params["limit"] = limit 48 } 49 if priority { 50 params["priority"] = priority 51 } 52 if len(reasons) != 0 { 53 params["reasons"] = reasons 54 } 55 if seenAt != "" { 56 params["seenAt"] = seenAt 57 } 58 if err := c.LexDo(ctx, util.Query, "", "app.bsky.notification.listNotifications", params, nil, &out); err != nil { 59 return nil, err 60 } 61 62 return &out, nil 63}