import DocumentDetector

public struct ResolutionSettingsDeserializer: Decodable {
    private let resolutionSettings: CafResolution?
    
    private enum CodingKeys: String, CodingKey {
        case resolutionSettings
    }
    
    public init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: CodingKeys.self)
        
        if let resolutionSettingsValue = try container.decodeIfPresent(String.self, forKey: .resolutionSettings) {
            resolutionSettings = CafResolution(rawValue: resolutionSettingsValue)
        } else {
            resolutionSettings = nil
        }
    }
    
    var getResolutionSettings: CafResolution? {
        resolutionSettings
    }
}
