//
//  AbonentSettings.swift
//  kt
//
//  Created by Alexander Zalutskiy on 24.08.15.
//  Copyright © 2015 Alexandr Zalutskiy. All rights reserved.
//

import Foundation

class AbonentSettings {
  //  let question: String?
  //  let answer: String?
  let isAdv: Bool?
  let maximumPasswordChangeAttempt: Int?
  let maximumLoginCount: Int?
  let idleTimeout: Int?
  let notificationPortalPasswordChange: Int?
  let mobilePhone: Int64?
  let isSmsActive: Bool?
  
  init(json: JSON) {
    
    //				self.question = question
    //				self.answer = answer
    self.isAdv = json["is_adv"].int == 1
    self.maximumPasswordChangeAttempt = json["max_pswd_change_attempt"].int
    self.maximumLoginCount = json["max_logon_count"].int
    self.idleTimeout = json["idle_timeout"].int
    self.notificationPortalPasswordChange = json["notif_portal_pswd_change"].int
    self.mobilePhone = json["mobile_phone"].int64
    self.isSmsActive = json["is_sms_active"].int == 1
    
    //    if
    //      //            let question = json["question"].string,
    //      //			let answer = json["answer"].string,
    //      let isAdv = json["is_adv"].int,
    //      let maximumPasswordChangeAttempt = json["max_pswd_change_attempt"].int,
    //      let maximumLoginCount = json["max_logon_count"].int,
    //      let idleTimeout = json["idle_timeout"].int,
    //      let notificationPortalPasswordChange = json["notif_portal_pswd_change"].int,
    //      let mobilePhone = json["mobile_phone"].int64,
    //      let isSmsActive = json["is_sms_active"].int {
    //      self.question = json["question"].string
    //      self.answer = json["answer"].string
    //      //				self.question = question
    //      //				self.answer = answer
    //      self.isAdv = (isAdv == 1)
    //      self.maximumPasswordChangeAttempt = maximumPasswordChangeAttempt
    //      self.maximumLoginCount = maximumLoginCount
    //      self.idleTimeout = idleTimeout
    //      self.notificationPortalPasswordChange = notificationPortalPasswordChange
    //      self.mobilePhone = mobilePhone
    //      self.isSmsActive = (isSmsActive == 1)
    //    } else {
    //
    //      question = ""
    //      answer = ""
    //      isAdv = false
    //      maximumLoginCount = 0
    //      maximumPasswordChangeAttempt = 0
    //      idleTimeout = 0
    //      notificationPortalPasswordChange = 0
    //      mobilePhone = 0
    //      isSmsActive = false
    //
    //      return nil
    //    }
  }
}
