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

import Foundation

public class RoleDtoEntity: APIModel {

    public var ghuRole: RoleEnum?

    public var grpAlias: String?

    public var grpName: String?

    public init(ghuRole: RoleEnum? = nil, grpAlias: String? = nil, grpName: String? = nil) {
        self.ghuRole = ghuRole
        self.grpAlias = grpAlias
        self.grpName = grpName
    }

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

        ghuRole = try container.decodeIfPresent("ghuRole")
        grpAlias = try container.decodeIfPresent("grpAlias")
        grpName = try container.decodeIfPresent("grpName")
    }

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

        try container.encodeIfPresent(ghuRole, forKey: "ghuRole")
        try container.encodeIfPresent(grpAlias, forKey: "grpAlias")
        try container.encodeIfPresent(grpName, forKey: "grpName")
    }

    public func isEqual(to object: Any?) -> Bool {
      guard let object = object as? RoleDtoEntity else { return false }
      guard self.ghuRole == object.ghuRole else { return false }
      guard self.grpAlias == object.grpAlias else { return false }
      guard self.grpName == object.grpName else { return false }
      return true
    }

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