//
// Generated by SwagGen
// https://github.com/yonaskolb/SwagGen
//
// Template used API+CLI
// https://github.com/csjones/SwagGen-templates
//

import Foundation

public class AddonsFeature: APIModel {

    public var available: Bool?

    public var description: String?

    public var quantity: String?

    public init(available: Bool? = nil, description: String? = nil, quantity: String? = nil) {
        self.available = available
        self.description = description
        self.quantity = quantity
    }

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

        available = try container.decodeIfPresent("available")
        description = try container.decodeIfPresent("description")
        quantity = try container.decodeIfPresent("quantity")
    }

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

        try container.encodeIfPresent(available, forKey: "available")
        try container.encodeIfPresent(description, forKey: "description")
        try container.encodeIfPresent(quantity, forKey: "quantity")
    }

    public func isEqual(to object: Any?) -> Bool {
      guard let object = object as? AddonsFeature else { return false }
      guard self.available == object.available else { return false }
      guard self.description == object.description else { return false }
      guard self.quantity == object.quantity else { return false }
      return true
    }

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