//
//  EncodableDataSource.swift
//  RNRookSdk
//
//  Created by Javier Villanueva on 17/12/25.
//

import RookSDK

struct EncodableDataSource: Encodable {
    
    private let dataSource: RookSDK.DataSourceStatus

    init(_ dataSource: RookSDK.DataSourceStatus) {
        self.dataSource = dataSource
    }

    private enum CodingKeys: String, CodingKey {
        case name
        case authorized
        case imageUrl
    }
  
    func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy: CodingKeys.self)

        try container.encode(dataSource.name, forKey: .name)
        try container.encode(dataSource.authorized, forKey: .authorized)
        try container.encode(dataSource.imageUrl, forKey: .imageUrl)
    }
}
