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

package bsky

// schema: app.bsky.notification.listNotifications

import (
	"context"

	comatprototypes "github.com/bluesky-social/indigo/api/atproto"
	"github.com/bluesky-social/indigo/lex/util"
	"github.com/bluesky-social/indigo/xrpc"
)

// NotificationListNotifications_Notification is a "notification" in the app.bsky.notification.listNotifications schema.
type NotificationListNotifications_Notification struct {
	Author    *ActorDefs_ProfileView             `json:"author" cborgen:"author"`
	Cid       string                             `json:"cid" cborgen:"cid"`
	IndexedAt string                             `json:"indexedAt" cborgen:"indexedAt"`
	IsRead    bool                               `json:"isRead" cborgen:"isRead"`
	Labels    []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"`
	// reason: Expected values are 'like', 'repost', 'follow', 'mention', 'reply', 'quote', and 'starterpack-joined'.
	Reason        string                   `json:"reason" cborgen:"reason"`
	ReasonSubject *string                  `json:"reasonSubject,omitempty" cborgen:"reasonSubject,omitempty"`
	Record        *util.LexiconTypeDecoder `json:"record" cborgen:"record"`
	Uri           string                   `json:"uri" cborgen:"uri"`
}

// NotificationListNotifications_Output is the output of a app.bsky.notification.listNotifications call.
type NotificationListNotifications_Output struct {
	Cursor        *string                                       `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	Notifications []*NotificationListNotifications_Notification `json:"notifications" cborgen:"notifications"`
	Priority      *bool                                         `json:"priority,omitempty" cborgen:"priority,omitempty"`
	SeenAt        *string                                       `json:"seenAt,omitempty" cborgen:"seenAt,omitempty"`
}

// NotificationListNotifications calls the XRPC method "app.bsky.notification.listNotifications".
func NotificationListNotifications(ctx context.Context, c *xrpc.Client, cursor string, limit int64, priority bool, seenAt string) (*NotificationListNotifications_Output, error) {
	var out NotificationListNotifications_Output

	params := map[string]interface{}{
		"cursor":   cursor,
		"limit":    limit,
		"priority": priority,
		"seenAt":   seenAt,
	}
	if err := c.Do(ctx, xrpc.Query, "", "app.bsky.notification.listNotifications", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
