Map<String, dynamic> toJSON() { final obj = <String, dynamic>{ 'type': type, 'invocationId': invocationId, }; obj.writeNotNull('headers', headers); obj.writeNotNull('item', item); return obj; }