Map<String, dynamic> toJson() { final field = this.field; final type = this.type; return { if (field != null) 'field': field, if (type != null) 'type': type.toValue(), }; }