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