Map<String, Object?> toJson() { final connections = this.connections; return { if (connections != null) 'connections': connections.map((v) => v.toJson()).toList(), }; }