//
// Generated by SwagGen
// https://github.com/yonaskolb/SwagGen
//

import Foundation

public class SecureTokenDtoEntity: APIModel {

    public var tknAlias: String

    public var tknBlockStatus: SecureTokenBlockStatusEnum

    public var tknCreated: DateTime

    public var tknName: String

    public var tknUpdated: DateTime

    public var tknAppBrowser: String?

    public var tknAppId: String?

    public var tknAppName: String?

    public var tknAppType: String?

    public var tknAppVersion: String?

    public var tknDeleted: DateTime?

    public var tknIsEnrolled: Bool?

    public var tknIsSync: Bool?

    public var tknLastAuthDate: DateTime?

    public var tknLibVersion: String?

    public var tknOsName: String?

    public var tknOsVersion: String?

    public var tknPushId: String?

    public var tknTypeName: String?

    public var tknVersion: String?

    public init(tknAlias: String, tknBlockStatus: SecureTokenBlockStatusEnum, tknCreated: DateTime, tknName: String, tknUpdated: DateTime, tknAppBrowser: String? = nil, tknAppId: String? = nil, tknAppName: String? = nil, tknAppType: String? = nil, tknAppVersion: String? = nil, tknDeleted: DateTime? = nil, tknIsEnrolled: Bool? = nil, tknIsSync: Bool? = nil, tknLastAuthDate: DateTime? = nil, tknLibVersion: String? = nil, tknOsName: String? = nil, tknOsVersion: String? = nil, tknPushId: String? = nil, tknTypeName: String? = nil, tknVersion: String? = nil) {
        self.tknAlias = tknAlias
        self.tknBlockStatus = tknBlockStatus
        self.tknCreated = tknCreated
        self.tknName = tknName
        self.tknUpdated = tknUpdated
        self.tknAppBrowser = tknAppBrowser
        self.tknAppId = tknAppId
        self.tknAppName = tknAppName
        self.tknAppType = tknAppType
        self.tknAppVersion = tknAppVersion
        self.tknDeleted = tknDeleted
        self.tknIsEnrolled = tknIsEnrolled
        self.tknIsSync = tknIsSync
        self.tknLastAuthDate = tknLastAuthDate
        self.tknLibVersion = tknLibVersion
        self.tknOsName = tknOsName
        self.tknOsVersion = tknOsVersion
        self.tknPushId = tknPushId
        self.tknTypeName = tknTypeName
        self.tknVersion = tknVersion
    }

    public required init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: StringCodingKey.self)

        tknAlias = try container.decode("tknAlias")
        tknBlockStatus = try container.decode("tknBlockStatus")
        tknCreated = try container.decode("tknCreated")
        tknName = try container.decode("tknName")
        tknUpdated = try container.decode("tknUpdated")
        tknAppBrowser = try container.decodeIfPresent("tknAppBrowser")
        tknAppId = try container.decodeIfPresent("tknAppId")
        tknAppName = try container.decodeIfPresent("tknAppName")
        tknAppType = try container.decodeIfPresent("tknAppType")
        tknAppVersion = try container.decodeIfPresent("tknAppVersion")
        tknDeleted = try container.decodeIfPresent("tknDeleted")
        tknIsEnrolled = try container.decodeIfPresent("tknIsEnrolled")
        tknIsSync = try container.decodeIfPresent("tknIsSync")
        tknLastAuthDate = try container.decodeIfPresent("tknLastAuthDate")
        tknLibVersion = try container.decodeIfPresent("tknLibVersion")
        tknOsName = try container.decodeIfPresent("tknOsName")
        tknOsVersion = try container.decodeIfPresent("tknOsVersion")
        tknPushId = try container.decodeIfPresent("tknPushId")
        tknTypeName = try container.decodeIfPresent("tknTypeName")
        tknVersion = try container.decodeIfPresent("tknVersion")
    }

    public func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy: StringCodingKey.self)

        try container.encode(tknAlias, forKey: "tknAlias")
        try container.encode(tknBlockStatus, forKey: "tknBlockStatus")
        try container.encode(tknCreated, forKey: "tknCreated")
        try container.encode(tknName, forKey: "tknName")
        try container.encode(tknUpdated, forKey: "tknUpdated")
        try container.encodeIfPresent(tknAppBrowser, forKey: "tknAppBrowser")
        try container.encodeIfPresent(tknAppId, forKey: "tknAppId")
        try container.encodeIfPresent(tknAppName, forKey: "tknAppName")
        try container.encodeIfPresent(tknAppType, forKey: "tknAppType")
        try container.encodeIfPresent(tknAppVersion, forKey: "tknAppVersion")
        try container.encodeIfPresent(tknDeleted, forKey: "tknDeleted")
        try container.encodeIfPresent(tknIsEnrolled, forKey: "tknIsEnrolled")
        try container.encodeIfPresent(tknIsSync, forKey: "tknIsSync")
        try container.encodeIfPresent(tknLastAuthDate, forKey: "tknLastAuthDate")
        try container.encodeIfPresent(tknLibVersion, forKey: "tknLibVersion")
        try container.encodeIfPresent(tknOsName, forKey: "tknOsName")
        try container.encodeIfPresent(tknOsVersion, forKey: "tknOsVersion")
        try container.encodeIfPresent(tknPushId, forKey: "tknPushId")
        try container.encodeIfPresent(tknTypeName, forKey: "tknTypeName")
        try container.encodeIfPresent(tknVersion, forKey: "tknVersion")
    }

    public func isEqual(to object: Any?) -> Bool {
      guard let object = object as? SecureTokenDtoEntity else { return false }
      guard self.tknAlias == object.tknAlias else { return false }
      guard self.tknBlockStatus == object.tknBlockStatus else { return false }
      guard self.tknCreated == object.tknCreated else { return false }
      guard self.tknName == object.tknName else { return false }
      guard self.tknUpdated == object.tknUpdated else { return false }
      guard self.tknAppBrowser == object.tknAppBrowser else { return false }
      guard self.tknAppId == object.tknAppId else { return false }
      guard self.tknAppName == object.tknAppName else { return false }
      guard self.tknAppType == object.tknAppType else { return false }
      guard self.tknAppVersion == object.tknAppVersion else { return false }
      guard self.tknDeleted == object.tknDeleted else { return false }
      guard self.tknIsEnrolled == object.tknIsEnrolled else { return false }
      guard self.tknIsSync == object.tknIsSync else { return false }
      guard self.tknLastAuthDate == object.tknLastAuthDate else { return false }
      guard self.tknLibVersion == object.tknLibVersion else { return false }
      guard self.tknOsName == object.tknOsName else { return false }
      guard self.tknOsVersion == object.tknOsVersion else { return false }
      guard self.tknPushId == object.tknPushId else { return false }
      guard self.tknTypeName == object.tknTypeName else { return false }
      guard self.tknVersion == object.tknVersion else { return false }
      return true
    }

    public static func == (lhs: SecureTokenDtoEntity, rhs: SecureTokenDtoEntity) -> Bool {
        return lhs.isEqual(to: rhs)
    }
}
