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

import Foundation

public class UserDtoEntity: APIModel {

    public var usrBlockStatus: UserBlockStatusEnum

    public var usrCreated: DateTime

    public var usrLogin: String

    public var usrUpdated: DateTime

    public var usrAlias: String?

    public var usrAltLogin1: String?

    public var usrAltLogin2: String?

    public var usrAltLogin3: String?

    public var usrDeleted: DateTime?

    public var usrDisplayName: String?

    public var usrEmail: String?

    public var usrFirstName: String?

    public var usrIsEnrolled: Bool?

    public var usrLanguage: String?

    public var usrLastActivityDate: DateTime?

    public var usrLastAuthDate: DateTime?

    public var usrLastName: String?

    public var usrRoles: [RoleDtoEntity]?

    public var usrSynchroHint: String?

    public init(usrBlockStatus: UserBlockStatusEnum, usrCreated: DateTime, usrLogin: String, usrUpdated: DateTime, usrAlias: String? = nil, usrAltLogin1: String? = nil, usrAltLogin2: String? = nil, usrAltLogin3: String? = nil, usrDeleted: DateTime? = nil, usrDisplayName: String? = nil, usrEmail: String? = nil, usrFirstName: String? = nil, usrIsEnrolled: Bool? = nil, usrLanguage: String? = nil, usrLastActivityDate: DateTime? = nil, usrLastAuthDate: DateTime? = nil, usrLastName: String? = nil, usrRoles: [RoleDtoEntity]? = nil, usrSynchroHint: String? = nil) {
        self.usrBlockStatus = usrBlockStatus
        self.usrCreated = usrCreated
        self.usrLogin = usrLogin
        self.usrUpdated = usrUpdated
        self.usrAlias = usrAlias
        self.usrAltLogin1 = usrAltLogin1
        self.usrAltLogin2 = usrAltLogin2
        self.usrAltLogin3 = usrAltLogin3
        self.usrDeleted = usrDeleted
        self.usrDisplayName = usrDisplayName
        self.usrEmail = usrEmail
        self.usrFirstName = usrFirstName
        self.usrIsEnrolled = usrIsEnrolled
        self.usrLanguage = usrLanguage
        self.usrLastActivityDate = usrLastActivityDate
        self.usrLastAuthDate = usrLastAuthDate
        self.usrLastName = usrLastName
        self.usrRoles = usrRoles
        self.usrSynchroHint = usrSynchroHint
    }

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

        usrBlockStatus = try container.decode("usrBlockStatus")
        usrCreated = try container.decode("usrCreated")
        usrLogin = try container.decode("usrLogin")
        usrUpdated = try container.decode("usrUpdated")
        usrAlias = try container.decodeIfPresent("usrAlias")
        usrAltLogin1 = try container.decodeIfPresent("usrAltLogin1")
        usrAltLogin2 = try container.decodeIfPresent("usrAltLogin2")
        usrAltLogin3 = try container.decodeIfPresent("usrAltLogin3")
        usrDeleted = try container.decodeIfPresent("usrDeleted")
        usrDisplayName = try container.decodeIfPresent("usrDisplayName")
        usrEmail = try container.decodeIfPresent("usrEmail")
        usrFirstName = try container.decodeIfPresent("usrFirstName")
        usrIsEnrolled = try container.decodeIfPresent("usrIsEnrolled")
        usrLanguage = try container.decodeIfPresent("usrLanguage")
        usrLastActivityDate = try container.decodeIfPresent("usrLastActivityDate")
        usrLastAuthDate = try container.decodeIfPresent("usrLastAuthDate")
        usrLastName = try container.decodeIfPresent("usrLastName")
        usrRoles = try container.decodeArrayIfPresent("usrRoles")
        usrSynchroHint = try container.decodeIfPresent("usrSynchroHint")
    }

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

        try container.encode(usrBlockStatus, forKey: "usrBlockStatus")
        try container.encode(usrCreated, forKey: "usrCreated")
        try container.encode(usrLogin, forKey: "usrLogin")
        try container.encode(usrUpdated, forKey: "usrUpdated")
        try container.encodeIfPresent(usrAlias, forKey: "usrAlias")
        try container.encodeIfPresent(usrAltLogin1, forKey: "usrAltLogin1")
        try container.encodeIfPresent(usrAltLogin2, forKey: "usrAltLogin2")
        try container.encodeIfPresent(usrAltLogin3, forKey: "usrAltLogin3")
        try container.encodeIfPresent(usrDeleted, forKey: "usrDeleted")
        try container.encodeIfPresent(usrDisplayName, forKey: "usrDisplayName")
        try container.encodeIfPresent(usrEmail, forKey: "usrEmail")
        try container.encodeIfPresent(usrFirstName, forKey: "usrFirstName")
        try container.encodeIfPresent(usrIsEnrolled, forKey: "usrIsEnrolled")
        try container.encodeIfPresent(usrLanguage, forKey: "usrLanguage")
        try container.encodeIfPresent(usrLastActivityDate, forKey: "usrLastActivityDate")
        try container.encodeIfPresent(usrLastAuthDate, forKey: "usrLastAuthDate")
        try container.encodeIfPresent(usrLastName, forKey: "usrLastName")
        try container.encodeIfPresent(usrRoles, forKey: "usrRoles")
        try container.encodeIfPresent(usrSynchroHint, forKey: "usrSynchroHint")
    }

    public func isEqual(to object: Any?) -> Bool {
      guard let object = object as? UserDtoEntity else { return false }
      guard self.usrBlockStatus == object.usrBlockStatus else { return false }
      guard self.usrCreated == object.usrCreated else { return false }
      guard self.usrLogin == object.usrLogin else { return false }
      guard self.usrUpdated == object.usrUpdated else { return false }
      guard self.usrAlias == object.usrAlias else { return false }
      guard self.usrAltLogin1 == object.usrAltLogin1 else { return false }
      guard self.usrAltLogin2 == object.usrAltLogin2 else { return false }
      guard self.usrAltLogin3 == object.usrAltLogin3 else { return false }
      guard self.usrDeleted == object.usrDeleted else { return false }
      guard self.usrDisplayName == object.usrDisplayName else { return false }
      guard self.usrEmail == object.usrEmail else { return false }
      guard self.usrFirstName == object.usrFirstName else { return false }
      guard self.usrIsEnrolled == object.usrIsEnrolled else { return false }
      guard self.usrLanguage == object.usrLanguage else { return false }
      guard self.usrLastActivityDate == object.usrLastActivityDate else { return false }
      guard self.usrLastAuthDate == object.usrLastAuthDate else { return false }
      guard self.usrLastName == object.usrLastName else { return false }
      guard self.usrRoles == object.usrRoles else { return false }
      guard self.usrSynchroHint == object.usrSynchroHint else { return false }
      return true
    }

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