Initial Marktplaats SDK scaffold

Clone the twdehands SDK into mrktplaats and retarget naming and defaults for app.marktplaats.nl while keeping the same request/response bodies and endpoint behavior.
This commit is contained in:
2026-04-15 23:45:49 +02:00
commit 25410749db
27 changed files with 3481 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
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
}