Map<String, dynamic> toJson() { final itemId = this.itemId; final properties = this.properties; return { 'itemId': itemId, if (properties != null) 'properties': jsonEncode(properties), }; }