Map<String, Object?> toJson() { var query = this.query; final json = <String, Object?>{}; if (query != null) { json[r'query'] = query; } return json; }