summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fatcat-cli/src/entities.rs55
1 files changed, 51 insertions, 4 deletions
diff --git a/fatcat-cli/src/entities.rs b/fatcat-cli/src/entities.rs
index 5e4ac06..14c9c29 100644
--- a/fatcat-cli/src/entities.rs
+++ b/fatcat-cli/src/entities.rs
@@ -220,6 +220,9 @@ impl ApiModelMutate for models::ReleaseEntity {
("subtitle", val) => {
self.subtitle = val;
}
+ ("original_title", val) => {
+ self.original_title = val;
+ }
("container_id", val) => {
self.container_id = val;
}
@@ -253,6 +256,13 @@ impl ApiModelMutate for models::ReleaseEntity {
("language", val) => {
self.language = val;
}
+ // None-only fields, for now
+ ("release_date", None) => {
+ self.release_date = None;
+ }
+ ("release_year", None) => {
+ self.release_year = None;
+ }
(field, _) => unimplemented!("setting field {} on a release", field),
}
}
@@ -276,6 +286,15 @@ impl ApiModelMutate for models::ContainerEntity {
("issnl", val) => {
self.issnl = val;
}
+ ("issne", val) => {
+ self.issne = val;
+ }
+ ("issnp", val) => {
+ self.issnp = val;
+ }
+ ("publication_status", val) => {
+ self.publication_status = val;
+ }
(field, _) => unimplemented!("setting field {} on a container", field),
}
}
@@ -331,6 +350,12 @@ impl ApiModelMutate for models::FileEntity {
("mimetype", val) => {
self.mimetype = val;
}
+ ("release_ids", None) => {
+ self.release_ids = None;
+ }
+ ("content_scope", val) => {
+ self.content_scope = val;
+ }
(field, _) => unimplemented!("setting field {} on a file", field),
}
}
@@ -339,14 +364,36 @@ impl ApiModelMutate for models::FileEntity {
}
impl ApiModelMutate for models::FilesetEntity {
- fn mutate(&mut self, _mutations: Vec<Mutation>) -> Result<()> {
- unimplemented!("mutations")
+ fn mutate(&mut self, mutations: Vec<Mutation>) -> Result<()> {
+ for m in mutations {
+ match (m.field.as_str(), m.value) {
+ ("release_ids", None) => {
+ self.release_ids = None;
+ }
+ ("content_scope", val) => {
+ self.content_scope = val;
+ }
+ (field, _) => unimplemented!("setting field {} on a fileset", field),
+ }
+ }
+ Ok(())
}
}
impl ApiModelMutate for models::WebcaptureEntity {
- fn mutate(&mut self, _mutations: Vec<Mutation>) -> Result<()> {
- unimplemented!("mutations")
+ fn mutate(&mut self, mutations: Vec<Mutation>) -> Result<()> {
+ for m in mutations {
+ match (m.field.as_str(), m.value) {
+ ("release_ids", None) => {
+ self.release_ids = None;
+ }
+ ("content_scope", val) => {
+ self.content_scope = val;
+ }
+ (field, _) => unimplemented!("setting field {} on a webcapture", field),
+ }
+ }
+ Ok(())
}
}