package mrktplaats import "context" // NotificationService handles notification counts. type NotificationService struct { t *transport } // NotificationEvent is an analytics event associated with notifications. type NotificationEvent struct { EventType string `json:"eventType"` Category string `json:"category"` Action string `json:"action"` Label string `json:"label"` } // UnreadCountResponse contains the unread notification count. type UnreadCountResponse struct { UnreadNotificationsCount int `json:"unreadNotificationsCount"` Events []NotificationEvent `json:"events"` } // UnreadCount returns the number of unread notifications. func (s *NotificationService) UnreadCount(ctx context.Context) (*UnreadCountResponse, error) { var resp UnreadCountResponse if err := s.t.get(ctx, "/app/notification-center/v1/unreadCount", nil, &resp); err != nil { return nil, err } return &resp, nil }