    
    func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy: CodingKeys.self)
        
        switch self {
        case .board(let board):
            try container.encode(board, forKey: .board)
        case .thread(let board, let thread):