// Generated by Create API
// https://github.com/CreateAPI/CreateAPI

import Foundation

/// Schema for notifications that are sent to the client.
/// 
/// Fields:
/// - id: The ID of the notification.
/// - priority: The priority of the notification.
///         0 is the highest priority, i.e. system announcement as banner.
///         2 is the default priority for notifications that don't require CTAs.
/// - updated_at: The timestamp of the notification.
/// - expires_at: The timestamp of the notification that determines the expiration of the notification.
/// - is_read: Whether the notification has been read.
/// - notification_type: The type of the notification.
/// - user_profiles: The profiles of the users that are mentioned in the notification.
/// - total_users: The total number of users that are mentioned in the notification.
/// - content_id: The ID of the content that is mentioned in the notification.
/// - content_title: The title of the content that is mentioned in the notification.
/// - content_image_url: The image URL of the content that is mentioned in the notification.
/// - content_message: The message of the content that is mentioned in the notification.
/// - redirect_url: The URL to redirect to when the notification is clicked.
public struct NotificationV2Schema: Codable, Equatable, Identifiable {
    public var contentAncillaryId: UUID?
    public var contentId: UUID?
    public var contentImageUrl: String?
    public var contentMessage: String?
    public var contentTitle: String?
    public var expiresAt: Date?
    public var id: UUID
    public var isRead: Bool
    public var notificationType: NotificationType?
    public var priority: Int?
    public var redirectUrl: String?
    public var totalUsers: Int?
    public var updatedAt: Date
    public var userProfiles: [MiniProfileV2Schema]?

    public struct NotificationType: RawRepresentable, Codable, Equatable {
        public let rawValue: String

        public init(rawValue: String) {
            self.rawValue = rawValue
        }

        public static let clipLike = Self(rawValue: "clip_like")
        public static let sceneLike = Self(rawValue: "scene_like")
        public static let clipCreateFollowee = Self(rawValue: "clip_create_followee")
        public static let playlistLike = Self(rawValue: "playlist_like")
        public static let codeRedeem = Self(rawValue: "code_redeem")
        public static let personaFavorite = Self(rawValue: "persona_favorite")
        public static let personaFollow = Self(rawValue: "persona_follow")
        public static let personaUsed = Self(rawValue: "persona_used")
        public static let announcement = Self(rawValue: "announcement")
        public static let follow = Self(rawValue: "follow")
        public static let invite = Self(rawValue: "invite")
        public static let inviteAccepted = Self(rawValue: "invite_accepted")
        public static let clipComment = Self(rawValue: "clip_comment")
        public static let sceneComment = Self(rawValue: "scene_comment")
        public static let playlistComment = Self(rawValue: "playlist_comment")
        public static let commentLike = Self(rawValue: "comment_like")
        public static let commentReply = Self(rawValue: "comment_reply")
        public static let commentMention = Self(rawValue: "comment_mention")
        public static let captionMention = Self(rawValue: "caption_mention")
        public static let clipRemix = Self(rawValue: "clip_remix")
        public static let shareClip = Self(rawValue: "share_clip")
        public static let delete = Self(rawValue: "delete")
        public static let `default` = Self(rawValue: "default")
        public static let hookLike = Self(rawValue: "hook_like")
        public static let hookComment = Self(rawValue: "hook_comment")
        public static let hookCommentReply = Self(rawValue: "hook_comment_reply")
        public static let hookCreated = Self(rawValue: "hook_created")
        public static let hookCommentLike = Self(rawValue: "hook_comment_like")
        public static let hookCommentMention = Self(rawValue: "hook_comment_mention")
        public static let videoCoverHookLike = Self(rawValue: "video_cover_hook_like")
        public static let videoCoverHookComment = Self(rawValue: "video_cover_hook_comment")
        public static let videoCoverHookCommentReply = Self(rawValue: "video_cover_hook_comment_reply")
        public static let videoCoverHookCommentLike = Self(rawValue: "video_cover_hook_comment_like")
        public static let videoCoverHookCommentMention = Self(rawValue: "video_cover_hook_comment_mention")
    }

    public init(contentAncillaryId: UUID? = nil, contentId: UUID? = nil, contentImageUrl: String? = nil, contentMessage: String? = nil, contentTitle: String? = nil, expiresAt: Date? = nil, id: UUID, isRead: Bool? = nil, notificationType: NotificationType? = nil, priority: Int? = nil, redirectUrl: String? = nil, totalUsers: Int? = nil, updatedAt: Date, userProfiles: [MiniProfileV2Schema]? = nil) {
        self.contentAncillaryId = contentAncillaryId
        self.contentId = contentId
        self.contentImageUrl = contentImageUrl
        self.contentMessage = contentMessage
        self.contentTitle = contentTitle
        self.expiresAt = expiresAt
        self.id = id
        self.isRead = isRead ?? false
        self.notificationType = notificationType
        self.priority = priority
        self.redirectUrl = redirectUrl
        self.totalUsers = totalUsers
        self.updatedAt = updatedAt
        self.userProfiles = userProfiles
    }
}
