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

import Foundation
#if canImport(AnyCodable)
    import AnyCodable
#endif

public final class TxMetadataLabel: Codable, Hashable {
    /** Metadata label */
    public var label: String
    /** CIP10 defined description */
    public var cip10: String?
    /** The count of metadata entries with a specific label */
    public var count: String

    public init(label: String, cip10: String?, count: String) {
        self.label = label
        self.cip10 = cip10
        self.count = count
    }

    public enum CodingKeys: String, CodingKey, CaseIterable {
        case label
        case cip10
        case count
    }

    // Encodable protocol methods

    public func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy: CodingKeys.self)
        try container.encode(label, forKey: .label)
        try container.encode(cip10, forKey: .cip10)
        try container.encode(count, forKey: .count)
    }

    public static func == (lhs: TxMetadataLabel, rhs: TxMetadataLabel) -> Bool {
        lhs.label == rhs.label &&
            lhs.cip10 == rhs.cip10 &&
            lhs.count == rhs.count
    }

    public func hash(into hasher: inout Hasher) {
        hasher.combine(label.hashValue)
        hasher.combine(cip10.hashValue)
        hasher.combine(count.hashValue)
    }
}
