import Foundation

struct BroadcastData : Codable {
    
    let id : Int?
    let user_id : Int?
    let name : String?
    let image : String?
    let time : Int?
    let org_image : String?
    let users : [UserData]?
    
    enum CodingKeys: String, CodingKey {
        case id = "id"
        case user_id = "user_id"
        case name = "name"
        case image = "image"
        case time = "time"
        case org_image = "org_image"
        case users = "users"
    }
    
    init(from decoder: Decoder) throws {
        let values = try decoder.container(keyedBy: CodingKeys.self)
        id = try values.decodeIfPresent(Int.self, forKey: .id)
        user_id = try values.decodeIfPresent(Int.self, forKey: .user_id)
        name = try values.decodeIfPresent(String.self, forKey: .name)
        image = try values.decodeIfPresent(String.self, forKey: .image)
        time = try values.decodeIfPresent(Int.self, forKey: .time)
        org_image = try values.decodeIfPresent(String.self, forKey: .org_image)
        users = try values.decodeIfPresent([UserData].self, forKey: .users)
    }
    
}
