//
//  CountryCodeAPIDataModel.swift


import Foundation

struct CountryCodeAPIDataModel : Codable{
    let country_list : [CountryListModel]?
}

struct CountryListModel : Codable{
    let name : String?
    let countrycode : String?
    let url : String?
    let regioncode : String?
    
    enum CodingKeys : String, CodingKey{
        case name = "name"
        case countrycode = "countrycode"
        case url = "url"
        case regioncode = "regioncode"
    }
    
    init(from decoder: Decoder) throws {
        let values = try decoder.container(keyedBy: CodingKeys.self)
        name = try values.decodeIfPresent(String.self, forKey: .name)
        countrycode = try values.decodeIfPresent(String.self, forKey: .countrycode)
        url = try values.decodeIfPresent(String.self, forKey: .url)
        regioncode = try values.decodeIfPresent(String.self, forKey: .regioncode)
    }
}
