aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/schema.py
diff options
context:
space:
mode:
Diffstat (limited to 'fatcat_scholar/schema.py')
-rw-r--r--fatcat_scholar/schema.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/fatcat_scholar/schema.py b/fatcat_scholar/schema.py
index 434f735..9377048 100644
--- a/fatcat_scholar/schema.py
+++ b/fatcat_scholar/schema.py
@@ -159,6 +159,20 @@ class ScholarFulltext(BaseModel):
access_url: Optional[str]
access_type: Optional[AccessType]
+ def remove_access(self) -> Any:
+ """
+ Returns a fulltext-indexable copy of self, but with access options and
+ file-level details removed
+ """
+ return ScholarFulltext(
+ lang_code=self.lang_code,
+ body=self.body,
+ acknowledgement=self.acknowledgement,
+ annex=self.annex,
+ release_ident=self.release_ident,
+ thumbnail_url=self.thumbnail_url,
+ )
+
class ScholarRelease(BaseModel):
ident: Optional[str]