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

import Foundation

public class AllowedConnectorDtoEntity: APIModel {

    public var cnxAlias: String?

    public var cnxName: String?

    public var connectorType: ConnectorTypeDtoEntity?

    public init(cnxAlias: String? = nil, cnxName: String? = nil, connectorType: ConnectorTypeDtoEntity? = nil) {
        self.cnxAlias = cnxAlias
        self.cnxName = cnxName
        self.connectorType = connectorType
    }

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

        cnxAlias = try container.decodeIfPresent("cnxAlias")
        cnxName = try container.decodeIfPresent("cnxName")
        connectorType = try container.decodeIfPresent("connectorType")
    }

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

        try container.encodeIfPresent(cnxAlias, forKey: "cnxAlias")
        try container.encodeIfPresent(cnxName, forKey: "cnxName")
        try container.encodeIfPresent(connectorType, forKey: "connectorType")
    }

    public func isEqual(to object: Any?) -> Bool {
      guard let object = object as? AllowedConnectorDtoEntity else { return false }
      guard self.cnxAlias == object.cnxAlias else { return false }
      guard self.cnxName == object.cnxName else { return false }
      guard self.connectorType == object.connectorType else { return false }
      return true
    }

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