//
//  Chat_data.swift
//  WoWonder
//
//  Created by UnikApp on 16/03/23.
//  Copyright © 2023 ScriptSun. All rights reserved.
//

import Foundation

struct Chat_data : Codable {
    
    let id : Int?
    let user_id : Int?
    let group_id : Int?
    let active : String?
    let last_seen : String?

    enum CodingKeys: String, CodingKey {

        case id = "id"
        case user_id = "user_id"
        case group_id = "group_id"
        case active = "active"
        case last_seen = "last_seen"
    }

    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)
        group_id = try values.decodeIfPresent(Int.self, forKey: .group_id)
        active = try values.decodeIfPresent(String.self, forKey: .active)
        last_seen = try values.decodeIfPresent(String.self, forKey: .last_seen)
    }
    
}
