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

import Foundation

public class CredentialDtoEntity: APIModel {

    public var crdActiveScribbleBits: Int?

    public var crdCreated: DateTime?

    public var crdCredErrors: Int?

    public var crdCredStatus: CredentialStatusEnum?

    public var crdTotalCredErrors: Int?

    public var crdUpdated: DateTime?

    public var scfName: String?

    public var tntAlias: String?

    public init(crdActiveScribbleBits: Int? = nil, crdCreated: DateTime? = nil, crdCredErrors: Int? = nil, crdCredStatus: CredentialStatusEnum? = nil, crdTotalCredErrors: Int? = nil, crdUpdated: DateTime? = nil, scfName: String? = nil, tntAlias: String? = nil) {
        self.crdActiveScribbleBits = crdActiveScribbleBits
        self.crdCreated = crdCreated
        self.crdCredErrors = crdCredErrors
        self.crdCredStatus = crdCredStatus
        self.crdTotalCredErrors = crdTotalCredErrors
        self.crdUpdated = crdUpdated
        self.scfName = scfName
        self.tntAlias = tntAlias
    }

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

        crdActiveScribbleBits = try container.decodeIfPresent("crdActiveScribbleBits")
        crdCreated = try container.decodeIfPresent("crdCreated")
        crdCredErrors = try container.decodeIfPresent("crdCredErrors")
        crdCredStatus = try container.decodeIfPresent("crdCredStatus")
        crdTotalCredErrors = try container.decodeIfPresent("crdTotalCredErrors")
        crdUpdated = try container.decodeIfPresent("crdUpdated")
        scfName = try container.decodeIfPresent("scfName")
        tntAlias = try container.decodeIfPresent("tntAlias")
    }

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

        try container.encodeIfPresent(crdActiveScribbleBits, forKey: "crdActiveScribbleBits")
        try container.encodeIfPresent(crdCreated, forKey: "crdCreated")
        try container.encodeIfPresent(crdCredErrors, forKey: "crdCredErrors")
        try container.encodeIfPresent(crdCredStatus, forKey: "crdCredStatus")
        try container.encodeIfPresent(crdTotalCredErrors, forKey: "crdTotalCredErrors")
        try container.encodeIfPresent(crdUpdated, forKey: "crdUpdated")
        try container.encodeIfPresent(scfName, forKey: "scfName")
        try container.encodeIfPresent(tntAlias, forKey: "tntAlias")
    }

    public func isEqual(to object: Any?) -> Bool {
      guard let object = object as? CredentialDtoEntity else { return false }
      guard self.crdActiveScribbleBits == object.crdActiveScribbleBits else { return false }
      guard self.crdCreated == object.crdCreated else { return false }
      guard self.crdCredErrors == object.crdCredErrors else { return false }
      guard self.crdCredStatus == object.crdCredStatus else { return false }
      guard self.crdTotalCredErrors == object.crdTotalCredErrors else { return false }
      guard self.crdUpdated == object.crdUpdated else { return false }
      guard self.scfName == object.scfName else { return false }
      guard self.tntAlias == object.tntAlias else { return false }
      return true
    }

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