@override Map<String, dynamic> toJson() => { 'type': type.toJson(), 'key': key, if (options != null) 'options': options!.toJson(), };