NotificationEventType (wire keys confirmed live), OutlineUser.notification Settings dictionary, subscribeToNotifications/unsubscribeFromNotifications (users.notificationsSubscribe/Unsubscribe, nil eventType = all — confirmed against the "All notifications" master toggle live too).
36 lines
1.1 KiB
Swift
36 lines
1.1 KiB
Swift
import Foundation
|
|
|
|
public struct OutlineUser: Codable, Identifiable, Hashable, Sendable {
|
|
public let id: String
|
|
public let name: String
|
|
public let email: String?
|
|
public let avatarUrl: String?
|
|
public let role: String?
|
|
public let language: String?
|
|
public let preferences: OutlineUserPreferences?
|
|
/// Keyed by `NotificationEventType`'s raw values, plus event types this
|
|
/// app has no UI for — kept as a flexible dictionary rather than a
|
|
/// fixed struct for that reason. `true` means subscribed.
|
|
public let notificationSettings: [String: Bool]?
|
|
|
|
public init(
|
|
id: String,
|
|
name: String,
|
|
email: String? = nil,
|
|
avatarUrl: String? = nil,
|
|
role: String? = nil,
|
|
language: String? = nil,
|
|
preferences: OutlineUserPreferences? = nil,
|
|
notificationSettings: [String: Bool]? = nil
|
|
) {
|
|
self.id = id
|
|
self.name = name
|
|
self.email = email
|
|
self.avatarUrl = avatarUrl
|
|
self.role = role
|
|
self.language = language
|
|
self.preferences = preferences
|
|
self.notificationSettings = notificationSettings
|
|
}
|
|
}
|