//
// SeatDiscount.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

import AnyCodable
import Foundation
import Vapor

/** This object contains information about a seat discount. */
public final class SeatDiscount: Content, Hashable {
    /** Reserved for DocuSign. */
    public var beginSeatCount: String?
    /** The percent of the discount.   Example: `\"0.00\"` */
    public var discountPercent: String?
    /** Reserved for DocuSign. */
    public var endSeatCount: String?

    public init(beginSeatCount: String? = nil, discountPercent: String? = nil, endSeatCount: String? = nil) {
        self.beginSeatCount = beginSeatCount
        self.discountPercent = discountPercent
        self.endSeatCount = endSeatCount
    }

    public enum CodingKeys: String, CodingKey, CaseIterable {
        case beginSeatCount
        case discountPercent
        case endSeatCount
    }

    // Encodable protocol methods

    public func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy: CodingKeys.self)
        try container.encodeIfPresent(beginSeatCount, forKey: .beginSeatCount)
        try container.encodeIfPresent(discountPercent, forKey: .discountPercent)
        try container.encodeIfPresent(endSeatCount, forKey: .endSeatCount)
    }

    public static func == (lhs: SeatDiscount, rhs: SeatDiscount) -> Bool {
        lhs.beginSeatCount == rhs.beginSeatCount &&
            lhs.discountPercent == rhs.discountPercent &&
            lhs.endSeatCount == rhs.endSeatCount
    }

    public func hash(into hasher: inout Hasher) {
        hasher.combine(beginSeatCount?.hashValue)
        hasher.combine(discountPercent?.hashValue)
        hasher.combine(endSeatCount?.hashValue)
    }
}
