//
//  RewardedAdModel.swift
//  sdk-demo-ios
//
//  Created by Smaato Inc on 10.07.18.
//  Copyright © 2018 Smaato Inc. All rights reserved.
//

import Foundation

struct RewardedAdModel: 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)
    }
}
