@override Object toJson() => { 'resource': resource, if (options case final options?) 'options': options.toJson(), };