//
//  InterstitialAdModel.swift
//  sdk-demo-ios
//
//  Created by Smaato Inc on 22.02.19.
//  Copyright © 2019 Smaato Inc. All rights reserved.
//

import Foundation

struct InterstitialAdModel: AdModel {
    var publisherId: String
    var adSpaceId: String
    var name: String
    var isCustom: Bool

    init(publisherId: String, adSpaceId: String, name: String, isCustom: Bool) {
        self.publisherId = publisherId
        self.adSpaceId = adSpaceId
        self.name = name
        self.isCustom = isCustom
    }

    init?(dictionary: [String: Any]) {
        guard let publisherId = dictionary["publisherId"],
              let adSpaceId = dictionary["adSpaceId"],
              let name = dictionary["name"],
              let isCustom = dictionary["isCustom"] else {
            return nil
        }
        self.init(publisherId: publisherId as! String, adSpaceId: adSpaceId as! String, name: name as! String, isCustom: isCustom as! Bool)
    }
}
