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

import Foundation

/// Extended history entity with additional metadata for favorites view.
public struct FavoriteEntity: Codable, Equatable, Identifiable {
    public var clipId: String
    public var createdAt: String?
    public var displayOrder: Int
    public var id: String
    public var isLiked: Bool
    public var prompt: String?
    public var status: Status
    public var thumbnailUrl: String?
    public var title: String?
    public var type: `Type`
    public var url: String?
    public var videoUploadId: String?

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

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

        public static let processing = Self(rawValue: "processing")
        public static let complete = Self(rawValue: "complete")
        public static let error = Self(rawValue: "error")
    }

    /// Type
    public struct `Type`: RawRepresentable, Codable, Equatable {
        public let rawValue: String

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

        public static let video = Self(rawValue: "video")
        public static let image = Self(rawValue: "image")
    }

    public init(clipId: String, createdAt: String? = nil, displayOrder: Int, id: String, isLiked: Bool? = nil, prompt: String? = nil, status: Status, thumbnailUrl: String? = nil, title: String? = nil, type: `Type`, url: String? = nil, videoUploadId: String? = nil) {
        self.clipId = clipId
        self.createdAt = createdAt
        self.displayOrder = displayOrder
        self.id = id
        self.isLiked = isLiked ?? false
        self.prompt = prompt
        self.status = status
        self.thumbnailUrl = thumbnailUrl
        self.title = title
        self.type = type
        self.url = url
        self.videoUploadId = videoUploadId
    }
}
