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

import Foundation

public class ActivationLinkResponseEntity: APIModel {

    public var code: String?

    public var regPkgAlias: String?

    public var serverUrl: String?

    public init(code: String? = nil, regPkgAlias: String? = nil, serverUrl: String? = nil) {
        self.code = code
        self.regPkgAlias = regPkgAlias
        self.serverUrl = serverUrl
    }

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

        code = try container.decodeIfPresent("code")
        regPkgAlias = try container.decodeIfPresent("regPkgAlias")
        serverUrl = try container.decodeIfPresent("serverUrl")
    }

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

        try container.encodeIfPresent(code, forKey: "code")
        try container.encodeIfPresent(regPkgAlias, forKey: "regPkgAlias")
        try container.encodeIfPresent(serverUrl, forKey: "serverUrl")
    }

    public func isEqual(to object: Any?) -> Bool {
      guard let object = object as? ActivationLinkResponseEntity else { return false }
      guard self.code == object.code else { return false }
      guard self.regPkgAlias == object.regPkgAlias else { return false }
      guard self.serverUrl == object.serverUrl else { return false }
      return true
    }

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