//
//  FriendListAPIModel.swift


import Foundation

struct FriendListAPIModel : Codable{
    let friend_list : [FriendListModel]
}

struct FriendListModel : Codable{
    let friend_id : Int?
    let full_name : String?
    let phone : String?
    let country_code : String?
    var isSelected : Bool?
    
    enum Codingkeys : String, CodingKey{
        case friend_id = "friend_id"
        case full_name = "full_name"
        case phone = "phone"
        case country_code = "country_code"
        case isSelected = "isSelected"
    }
    
    init(from decoder: Decoder) throws {
        let values = try decoder.container(keyedBy: CodingKeys.self)
        friend_id = try values.decodeIfPresent(Int.self, forKey: .friend_id)
        full_name = try values.decodeIfPresent(String.self, forKey: .full_name)
        phone = try values.decodeIfPresent(String.self, forKey: .phone)
        country_code = try values.decodeIfPresent(String.self, forKey: .country_code)
        isSelected = try values.decodeIfPresent(Bool.self, forKey: .isSelected)
    }
}
