diff options
Diffstat (limited to 'rust/fatcat-api-spec/src')
-rw-r--r-- | rust/fatcat-api-spec/src/client.rs | 78 | ||||
-rw-r--r-- | rust/fatcat-api-spec/src/lib.rs | 93 | ||||
-rw-r--r-- | rust/fatcat-api-spec/src/models.rs | 62 | ||||
-rw-r--r-- | rust/fatcat-api-spec/src/server.rs | 240 |
4 files changed, 395 insertions, 78 deletions
diff --git a/rust/fatcat-api-spec/src/client.rs b/rust/fatcat-api-spec/src/client.rs index a3e97fb3..6d654146 100644 --- a/rust/fatcat-api-spec/src/client.rs +++ b/rust/fatcat-api-spec/src/client.rs @@ -272,17 +272,23 @@ impl Api for Client { param_entity_list: &Vec<models::ContainerEntity>, param_autoaccept: Option<bool>, param_editgroup_id: Option<String>, + param_description: Option<String>, + param_extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateContainerBatchResponse, Error = ApiError> + Send> { // Query parameters let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string())); let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string())); + let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string())); + let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string())); let url = format!( - "{}/v0/container/batch?{autoaccept}{editgroup_id}", + "{}/v0/container/batch?{autoaccept}{editgroup_id}{description}{extra}", self.base_path, autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET), - editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET) + editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET), + description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET), + extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET) ); let body = serde_json::to_string(¶m_entity_list).expect("impossible to fail to serialize"); @@ -1167,17 +1173,23 @@ impl Api for Client { param_entity_list: &Vec<models::CreatorEntity>, param_autoaccept: Option<bool>, param_editgroup_id: Option<String>, + param_description: Option<String>, + param_extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateCreatorBatchResponse, Error = ApiError> + Send> { // Query parameters let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string())); let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string())); + let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string())); + let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string())); let url = format!( - "{}/v0/creator/batch?{autoaccept}{editgroup_id}", + "{}/v0/creator/batch?{autoaccept}{editgroup_id}{description}{extra}", self.base_path, autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET), - editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET) + editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET), + description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET), + extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET) ); let body = serde_json::to_string(¶m_entity_list).expect("impossible to fail to serialize"); @@ -3364,17 +3376,23 @@ impl Api for Client { param_entity_list: &Vec<models::FileEntity>, param_autoaccept: Option<bool>, param_editgroup_id: Option<String>, + param_description: Option<String>, + param_extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send> { // Query parameters let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string())); let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string())); + let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string())); + let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string())); let url = format!( - "{}/v0/file/batch?{autoaccept}{editgroup_id}", + "{}/v0/file/batch?{autoaccept}{editgroup_id}{description}{extra}", self.base_path, autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET), - editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET) + editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET), + description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET), + extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET) ); let body = serde_json::to_string(¶m_entity_list).expect("impossible to fail to serialize"); @@ -4256,17 +4274,23 @@ impl Api for Client { param_entity_list: &Vec<models::FilesetEntity>, param_autoaccept: Option<bool>, param_editgroup_id: Option<String>, + param_description: Option<String>, + param_extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateFilesetBatchResponse, Error = ApiError> + Send> { // Query parameters let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string())); let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string())); + let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string())); + let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string())); let url = format!( - "{}/v0/fileset/batch?{autoaccept}{editgroup_id}", + "{}/v0/fileset/batch?{autoaccept}{editgroup_id}{description}{extra}", self.base_path, autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET), - editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET) + editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET), + description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET), + extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET) ); let body = serde_json::to_string(¶m_entity_list).expect("impossible to fail to serialize"); @@ -5071,17 +5095,23 @@ impl Api for Client { param_entity_list: &Vec<models::ReleaseEntity>, param_autoaccept: Option<bool>, param_editgroup_id: Option<String>, + param_description: Option<String>, + param_extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateReleaseBatchResponse, Error = ApiError> + Send> { // Query parameters let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string())); let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string())); + let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string())); + let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string())); let url = format!( - "{}/v0/release/batch?{autoaccept}{editgroup_id}", + "{}/v0/release/batch?{autoaccept}{editgroup_id}{description}{extra}", self.base_path, autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET), - editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET) + editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET), + description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET), + extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET) ); let body = serde_json::to_string(¶m_entity_list).expect("impossible to fail to serialize"); @@ -5988,6 +6018,8 @@ impl Api for Client { param_pmid: Option<String>, param_pmcid: Option<String>, param_core_id: Option<String>, + param_arxiv_id: Option<String>, + param_jstor_id: Option<String>, param_expand: Option<String>, param_hide: Option<String>, context: &Context, @@ -5999,11 +6031,13 @@ impl Api for Client { let query_pmid = param_pmid.map_or_else(String::new, |query| format!("pmid={pmid}&", pmid = query.to_string())); let query_pmcid = param_pmcid.map_or_else(String::new, |query| format!("pmcid={pmcid}&", pmcid = query.to_string())); let query_core_id = param_core_id.map_or_else(String::new, |query| format!("core_id={core_id}&", core_id = query.to_string())); + let query_arxiv_id = param_arxiv_id.map_or_else(String::new, |query| format!("arxiv_id={arxiv_id}&", arxiv_id = query.to_string())); + let query_jstor_id = param_jstor_id.map_or_else(String::new, |query| format!("jstor_id={jstor_id}&", jstor_id = query.to_string())); let query_expand = param_expand.map_or_else(String::new, |query| format!("expand={expand}&", expand = query.to_string())); let query_hide = param_hide.map_or_else(String::new, |query| format!("hide={hide}&", hide = query.to_string())); let url = format!( - "{}/v0/release/lookup?{doi}{wikidata_qid}{isbn13}{pmid}{pmcid}{core_id}{expand}{hide}", + "{}/v0/release/lookup?{doi}{wikidata_qid}{isbn13}{pmid}{pmcid}{core_id}{arxiv_id}{jstor_id}{expand}{hide}", self.base_path, doi = utf8_percent_encode(&query_doi, QUERY_ENCODE_SET), wikidata_qid = utf8_percent_encode(&query_wikidata_qid, QUERY_ENCODE_SET), @@ -6011,6 +6045,8 @@ impl Api for Client { pmid = utf8_percent_encode(&query_pmid, QUERY_ENCODE_SET), pmcid = utf8_percent_encode(&query_pmcid, QUERY_ENCODE_SET), core_id = utf8_percent_encode(&query_core_id, QUERY_ENCODE_SET), + arxiv_id = utf8_percent_encode(&query_arxiv_id, QUERY_ENCODE_SET), + jstor_id = utf8_percent_encode(&query_jstor_id, QUERY_ENCODE_SET), expand = utf8_percent_encode(&query_expand, QUERY_ENCODE_SET), hide = utf8_percent_encode(&query_hide, QUERY_ENCODE_SET) ); @@ -6272,17 +6308,23 @@ impl Api for Client { param_entity_list: &Vec<models::WebcaptureEntity>, param_autoaccept: Option<bool>, param_editgroup_id: Option<String>, + param_description: Option<String>, + param_extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateWebcaptureBatchResponse, Error = ApiError> + Send> { // Query parameters let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string())); let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string())); + let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string())); + let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string())); let url = format!( - "{}/v0/webcapture/batch?{autoaccept}{editgroup_id}", + "{}/v0/webcapture/batch?{autoaccept}{editgroup_id}{description}{extra}", self.base_path, autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET), - editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET) + editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET), + description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET), + extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET) ); let body = serde_json::to_string(¶m_entity_list).expect("impossible to fail to serialize"); @@ -6993,17 +7035,23 @@ impl Api for Client { param_entity_list: &Vec<models::WorkEntity>, param_autoaccept: Option<bool>, param_editgroup_id: Option<String>, + param_description: Option<String>, + param_extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send> { // Query parameters let query_autoaccept = param_autoaccept.map_or_else(String::new, |query| format!("autoaccept={autoaccept}&", autoaccept = query.to_string())); let query_editgroup_id = param_editgroup_id.map_or_else(String::new, |query| format!("editgroup_id={editgroup_id}&", editgroup_id = query.to_string())); + let query_description = param_description.map_or_else(String::new, |query| format!("description={description}&", description = query.to_string())); + let query_extra = param_extra.map_or_else(String::new, |query| format!("extra={extra}&", extra = query.to_string())); let url = format!( - "{}/v0/work/batch?{autoaccept}{editgroup_id}", + "{}/v0/work/batch?{autoaccept}{editgroup_id}{description}{extra}", self.base_path, autoaccept = utf8_percent_encode(&query_autoaccept, QUERY_ENCODE_SET), - editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET) + editgroup_id = utf8_percent_encode(&query_editgroup_id, QUERY_ENCODE_SET), + description = utf8_percent_encode(&query_description, QUERY_ENCODE_SET), + extra = utf8_percent_encode(&query_extra, QUERY_ENCODE_SET) ); let body = serde_json::to_string(¶m_entity_list).expect("impossible to fail to serialize"); diff --git a/rust/fatcat-api-spec/src/lib.rs b/rust/fatcat-api-spec/src/lib.rs index 9585f1c0..59129869 100644 --- a/rust/fatcat-api-spec/src/lib.rs +++ b/rust/fatcat-api-spec/src/lib.rs @@ -1345,6 +1345,8 @@ pub trait Api { entity_list: &Vec<models::ContainerEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateContainerBatchResponse, Error = ApiError> + Send>; @@ -1380,6 +1382,8 @@ pub trait Api { entity_list: &Vec<models::CreatorEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateCreatorBatchResponse, Error = ApiError> + Send>; @@ -1473,6 +1477,8 @@ pub trait Api { entity_list: &Vec<models::FileEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send>; @@ -1509,6 +1515,8 @@ pub trait Api { entity_list: &Vec<models::FilesetEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateFilesetBatchResponse, Error = ApiError> + Send>; @@ -1535,6 +1543,8 @@ pub trait Api { entity_list: &Vec<models::ReleaseEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateReleaseBatchResponse, Error = ApiError> + Send>; @@ -1568,6 +1578,8 @@ pub trait Api { pmid: Option<String>, pmcid: Option<String>, core_id: Option<String>, + arxiv_id: Option<String>, + jstor_id: Option<String>, expand: Option<String>, hide: Option<String>, context: &Context, @@ -1582,6 +1594,8 @@ pub trait Api { entity_list: &Vec<models::WebcaptureEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateWebcaptureBatchResponse, Error = ApiError> + Send>; @@ -1606,6 +1620,8 @@ pub trait Api { entity_list: &Vec<models::WorkEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, context: &Context, ) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send>; @@ -1637,6 +1653,8 @@ pub trait ApiNoContext { entity_list: &Vec<models::ContainerEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, ) -> Box<Future<Item = CreateContainerBatchResponse, Error = ApiError> + Send>; fn delete_container(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteContainerResponse, Error = ApiError> + Send>; @@ -1670,6 +1688,8 @@ pub trait ApiNoContext { entity_list: &Vec<models::CreatorEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, ) -> Box<Future<Item = CreateCreatorBatchResponse, Error = ApiError> + Send>; fn delete_creator(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteCreatorResponse, Error = ApiError> + Send>; @@ -1742,7 +1762,14 @@ pub trait ApiNoContext { fn create_file(&self, entity: models::FileEntity, editgroup_id: String) -> Box<Future<Item = CreateFileResponse, Error = ApiError> + Send>; - fn create_file_batch(&self, entity_list: &Vec<models::FileEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send>; + fn create_file_batch( + &self, + entity_list: &Vec<models::FileEntity>, + autoaccept: Option<bool>, + editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, + ) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send>; fn delete_file(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteFileResponse, Error = ApiError> + Send>; @@ -1776,6 +1803,8 @@ pub trait ApiNoContext { entity_list: &Vec<models::FilesetEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, ) -> Box<Future<Item = CreateFilesetBatchResponse, Error = ApiError> + Send>; fn delete_fileset(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteFilesetResponse, Error = ApiError> + Send>; @@ -1801,6 +1830,8 @@ pub trait ApiNoContext { entity_list: &Vec<models::ReleaseEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, ) -> Box<Future<Item = CreateReleaseBatchResponse, Error = ApiError> + Send>; fn create_work(&self, entity: models::WorkEntity, editgroup_id: String) -> Box<Future<Item = CreateWorkResponse, Error = ApiError> + Send>; @@ -1833,6 +1864,8 @@ pub trait ApiNoContext { pmid: Option<String>, pmcid: Option<String>, core_id: Option<String>, + arxiv_id: Option<String>, + jstor_id: Option<String>, expand: Option<String>, hide: Option<String>, ) -> Box<Future<Item = LookupReleaseResponse, Error = ApiError> + Send>; @@ -1846,6 +1879,8 @@ pub trait ApiNoContext { entity_list: &Vec<models::WebcaptureEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, ) -> Box<Future<Item = CreateWebcaptureBatchResponse, Error = ApiError> + Send>; fn delete_webcapture(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteWebcaptureResponse, Error = ApiError> + Send>; @@ -1864,7 +1899,14 @@ pub trait ApiNoContext { fn update_webcapture(&self, ident: String, entity: models::WebcaptureEntity, editgroup_id: String) -> Box<Future<Item = UpdateWebcaptureResponse, Error = ApiError> + Send>; - fn create_work_batch(&self, entity_list: &Vec<models::WorkEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send>; + fn create_work_batch( + &self, + entity_list: &Vec<models::WorkEntity>, + autoaccept: Option<bool>, + editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, + ) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send>; fn delete_work(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteWorkResponse, Error = ApiError> + Send>; @@ -1910,8 +1952,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { entity_list: &Vec<models::ContainerEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, ) -> Box<Future<Item = CreateContainerBatchResponse, Error = ApiError> + Send> { - self.api().create_container_batch(entity_list, autoaccept, editgroup_id, &self.context()) + self.api().create_container_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn delete_container(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteContainerResponse, Error = ApiError> + Send> { @@ -1965,8 +2009,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { entity_list: &Vec<models::CreatorEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, ) -> Box<Future<Item = CreateCreatorBatchResponse, Error = ApiError> + Send> { - self.api().create_creator_batch(entity_list, autoaccept, editgroup_id, &self.context()) + self.api().create_creator_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn delete_creator(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteCreatorResponse, Error = ApiError> + Send> { @@ -2091,8 +2137,15 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().create_file(entity, editgroup_id, &self.context()) } - fn create_file_batch(&self, entity_list: &Vec<models::FileEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send> { - self.api().create_file_batch(entity_list, autoaccept, editgroup_id, &self.context()) + fn create_file_batch( + &self, + entity_list: &Vec<models::FileEntity>, + autoaccept: Option<bool>, + editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, + ) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send> { + self.api().create_file_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn delete_file(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteFileResponse, Error = ApiError> + Send> { @@ -2147,8 +2200,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { entity_list: &Vec<models::FilesetEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, ) -> Box<Future<Item = CreateFilesetBatchResponse, Error = ApiError> + Send> { - self.api().create_fileset_batch(entity_list, autoaccept, editgroup_id, &self.context()) + self.api().create_fileset_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn delete_fileset(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteFilesetResponse, Error = ApiError> + Send> { @@ -2192,8 +2247,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { entity_list: &Vec<models::ReleaseEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, ) -> Box<Future<Item = CreateReleaseBatchResponse, Error = ApiError> + Send> { - self.api().create_release_batch(entity_list, autoaccept, editgroup_id, &self.context()) + self.api().create_release_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn create_work(&self, entity: models::WorkEntity, editgroup_id: String) -> Box<Future<Item = CreateWorkResponse, Error = ApiError> + Send> { @@ -2248,10 +2305,13 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { pmid: Option<String>, pmcid: Option<String>, core_id: Option<String>, + arxiv_id: Option<String>, + jstor_id: Option<String>, expand: Option<String>, hide: Option<String>, ) -> Box<Future<Item = LookupReleaseResponse, Error = ApiError> + Send> { - self.api().lookup_release(doi, wikidata_qid, isbn13, pmid, pmcid, core_id, expand, hide, &self.context()) + self.api() + .lookup_release(doi, wikidata_qid, isbn13, pmid, pmcid, core_id, arxiv_id, jstor_id, expand, hide, &self.context()) } fn update_release(&self, ident: String, entity: models::ReleaseEntity, editgroup_id: String) -> Box<Future<Item = UpdateReleaseResponse, Error = ApiError> + Send> { @@ -2267,8 +2327,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { entity_list: &Vec<models::WebcaptureEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, ) -> Box<Future<Item = CreateWebcaptureBatchResponse, Error = ApiError> + Send> { - self.api().create_webcapture_batch(entity_list, autoaccept, editgroup_id, &self.context()) + self.api().create_webcapture_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn delete_webcapture(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteWebcaptureResponse, Error = ApiError> + Send> { @@ -2303,8 +2365,15 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().update_webcapture(ident, entity, editgroup_id, &self.context()) } - fn create_work_batch(&self, entity_list: &Vec<models::WorkEntity>, autoaccept: Option<bool>, editgroup_id: Option<String>) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send> { - self.api().create_work_batch(entity_list, autoaccept, editgroup_id, &self.context()) + fn create_work_batch( + &self, + entity_list: &Vec<models::WorkEntity>, + autoaccept: Option<bool>, + editgroup_id: Option<String>, + description: Option<String>, + extra: Option<String>, + ) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send> { + self.api().create_work_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn delete_work(&self, ident: String, editgroup_id: String) -> Box<Future<Item = DeleteWorkResponse, Error = ApiError> + Send> { diff --git a/rust/fatcat-api-spec/src/models.rs b/rust/fatcat-api-spec/src/models.rs index 5d05b737..d6e6e07f 100644 --- a/rust/fatcat-api-spec/src/models.rs +++ b/rust/fatcat-api-spec/src/models.rs @@ -79,14 +79,6 @@ impl ChangelogEntry { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ContainerEntity { - #[serde(rename = "coden")] - #[serde(skip_serializing_if = "Option::is_none")] - pub coden: Option<String>, - - #[serde(rename = "abbrev")] - #[serde(skip_serializing_if = "Option::is_none")] - pub abbrev: Option<String>, - #[serde(rename = "wikidata_qid")] #[serde(skip_serializing_if = "Option::is_none")] pub wikidata_qid: Option<String>, @@ -99,6 +91,11 @@ pub struct ContainerEntity { #[serde(skip_serializing_if = "Option::is_none")] pub publisher: Option<String>, + /// Eg, 'journal' + #[serde(rename = "container_type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub container_type: Option<String>, + /// Required for valid entities #[serde(rename = "name")] #[serde(skip_serializing_if = "Option::is_none")] @@ -136,11 +133,10 @@ pub struct ContainerEntity { impl ContainerEntity { pub fn new() -> ContainerEntity { ContainerEntity { - coden: None, - abbrev: None, wikidata_qid: None, issnl: None, publisher: None, + container_type: None, name: None, edit_extra: None, extra: None, @@ -709,13 +705,18 @@ pub struct ReleaseContrib { #[serde(skip_serializing_if = "Option::is_none")] pub raw_name: Option<String>, - #[serde(rename = "extra")] - #[serde(skip_serializing_if = "Option::is_none")] - pub extra: Option<serde_json::Value>, - #[serde(rename = "role")] #[serde(skip_serializing_if = "Option::is_none")] pub role: Option<String>, + + /// Raw affiliation string as displayed in text + #[serde(rename = "raw_affiliation")] + #[serde(skip_serializing_if = "Option::is_none")] + pub raw_affiliation: Option<String>, + + #[serde(rename = "extra")] + #[serde(skip_serializing_if = "Option::is_none")] + pub extra: Option<serde_json::Value>, } impl ReleaseContrib { @@ -725,8 +726,9 @@ impl ReleaseContrib { creator_id: None, creator: None, raw_name: None, - extra: None, role: None, + raw_affiliation: None, + extra: None, } } } @@ -745,6 +747,11 @@ pub struct ReleaseEntity { #[serde(skip_serializing_if = "Option::is_none")] pub contribs: Option<Vec<models::ReleaseContrib>>, + /// Short version of license name. Eg, 'CC-BY' + #[serde(rename = "license_slug")] + #[serde(skip_serializing_if = "Option::is_none")] + pub license_slug: Option<String>, + /// Two-letter RFC1766/ISO639-1 language code, with extensions #[serde(rename = "language")] #[serde(skip_serializing_if = "Option::is_none")] @@ -766,6 +773,14 @@ pub struct ReleaseEntity { #[serde(skip_serializing_if = "Option::is_none")] pub volume: Option<String>, + #[serde(rename = "jstor_id")] + #[serde(skip_serializing_if = "Option::is_none")] + pub jstor_id: Option<String>, + + #[serde(rename = "arxiv_id")] + #[serde(skip_serializing_if = "Option::is_none")] + pub arxiv_id: Option<String>, + #[serde(rename = "core_id")] #[serde(skip_serializing_if = "Option::is_none")] pub core_id: Option<String>, @@ -834,7 +849,12 @@ pub struct ReleaseEntity { #[serde(skip_serializing_if = "Option::is_none")] pub work_id: Option<String>, - /// Required for valid entities + /// Title in original language (or, the language of the full text of this release) + #[serde(rename = "original_title")] + #[serde(skip_serializing_if = "Option::is_none")] + pub original_title: Option<String>, + + /// Required for valid entities. The title used in citations and for display; usually English #[serde(rename = "title")] #[serde(skip_serializing_if = "Option::is_none")] pub title: Option<String>, @@ -874,11 +894,14 @@ impl ReleaseEntity { abstracts: None, refs: None, contribs: None, + license_slug: None, language: None, publisher: None, pages: None, issue: None, volume: None, + jstor_id: None, + arxiv_id: None, core_id: None, pmcid: None, pmid: None, @@ -895,6 +918,7 @@ impl ReleaseEntity { files: None, container: None, work_id: None, + original_title: None, title: None, state: None, ident: None, @@ -1008,6 +1032,7 @@ pub struct WebcaptureEntity { #[serde(skip_serializing_if = "Option::is_none")] pub release_ids: Option<Vec<String>>, + /// same format as CDX line timestamp (UTC, etc). Corresponds to the overall capture timestamp. Can be the earliest or average of CDX timestamps if that makes sense. #[serde(rename = "timestamp")] #[serde(skip_serializing_if = "Option::is_none")] pub timestamp: Option<chrono::DateTime<chrono::Utc>>, @@ -1091,8 +1116,9 @@ pub struct WebcaptureEntityCdx { #[serde(rename = "surt")] pub surt: String, + /// UTC, 'Z'-terminated, second (or better) precision #[serde(rename = "timestamp")] - pub timestamp: String, + pub timestamp: chrono::DateTime<chrono::Utc>, #[serde(rename = "url")] pub url: String, @@ -1114,7 +1140,7 @@ pub struct WebcaptureEntityCdx { } impl WebcaptureEntityCdx { - pub fn new(surt: String, timestamp: String, url: String, sha1: String) -> WebcaptureEntityCdx { + pub fn new(surt: String, timestamp: chrono::DateTime<chrono::Utc>, url: String, sha1: String) -> WebcaptureEntityCdx { WebcaptureEntityCdx { surt: surt, timestamp: timestamp, diff --git a/rust/fatcat-api-spec/src/server.rs b/rust/fatcat-api-spec/src/server.rs index 8b616959..af13948e 100644 --- a/rust/fatcat-api-spec/src/server.rs +++ b/rust/fatcat-api-spec/src/server.rs @@ -262,8 +262,15 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok()); + let param_autoaccept = query_params + .get("autoaccept") + .and_then(|list| list.first()) + .and_then(|x| Some(x.to_lowercase().parse::<bool>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?; let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for @@ -290,7 +297,10 @@ where }; let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?; - match api.create_container_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() { + match api + .create_container_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context) + .wait() + { Ok(rsp) => match rsp { CreateContainerBatchResponse::CreatedEntities(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -837,7 +847,12 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok()); + let param_limit = query_params + .get("limit") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<i64>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?; match api.get_container_history(param_ident, param_limit, context).wait() { Ok(rsp) => match rsp { @@ -1488,8 +1503,15 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok()); + let param_autoaccept = query_params + .get("autoaccept") + .and_then(|list| list.first()) + .and_then(|x| Some(x.to_lowercase().parse::<bool>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?; let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for @@ -1516,7 +1538,10 @@ where }; let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?; - match api.create_creator_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() { + match api + .create_creator_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context) + .wait() + { Ok(rsp) => match rsp { CreateCreatorBatchResponse::CreatedEntities(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -2063,7 +2088,12 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok()); + let param_limit = query_params + .get("limit") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<i64>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?; match api.get_creator_history(param_ident, param_limit, context).wait() { Ok(rsp) => match rsp { @@ -2901,9 +2931,24 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); let param_expand = query_params.get("expand").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); - let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok()); - let param_before = query_params.get("before").and_then(|list| list.first()).and_then(|x| x.parse::<chrono::DateTime<chrono::Utc>>().ok()); - let param_since = query_params.get("since").and_then(|list| list.first()).and_then(|x| x.parse::<chrono::DateTime<chrono::Utc>>().ok()); + let param_limit = query_params + .get("limit") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<i64>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?; + let param_before = query_params + .get("before") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<chrono::DateTime<chrono::Utc>>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected UTC datetime in ISO/RFC format)".to_string())))?; + let param_since = query_params + .get("since") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<chrono::DateTime<chrono::Utc>>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected UTC datetime in ISO/RFC format)".to_string())))?; match api.get_editgroups_reviewable(param_expand, param_limit, param_before, param_since, context).wait() { Ok(rsp) => match rsp { @@ -3085,9 +3130,24 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok()); - let param_before = query_params.get("before").and_then(|list| list.first()).and_then(|x| x.parse::<chrono::DateTime<chrono::Utc>>().ok()); - let param_since = query_params.get("since").and_then(|list| list.first()).and_then(|x| x.parse::<chrono::DateTime<chrono::Utc>>().ok()); + let param_limit = query_params + .get("limit") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<i64>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?; + let param_before = query_params + .get("before") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<chrono::DateTime<chrono::Utc>>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected UTC datetime in ISO/RFC format)".to_string())))?; + let param_since = query_params + .get("since") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<chrono::DateTime<chrono::Utc>>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected UTC datetime in ISO/RFC format)".to_string())))?; match api.get_editor_editgroups(param_editor_id, param_limit, param_before, param_since, context).wait() { Ok(rsp) => match rsp { @@ -3182,7 +3242,12 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_submit = query_params.get("submit").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok()); + let param_submit = query_params + .get("submit") + .and_then(|list| list.first()) + .and_then(|x| Some(x.to_lowercase().parse::<bool>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?; // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for @@ -3882,7 +3947,12 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok()); + let param_limit = query_params + .get("limit") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<i64>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?; match api.get_changelog(param_limit, context).wait() { Ok(rsp) => match rsp { @@ -4261,9 +4331,24 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok()); - let param_before = query_params.get("before").and_then(|list| list.first()).and_then(|x| x.parse::<chrono::DateTime<chrono::Utc>>().ok()); - let param_since = query_params.get("since").and_then(|list| list.first()).and_then(|x| x.parse::<chrono::DateTime<chrono::Utc>>().ok()); + let param_limit = query_params + .get("limit") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<i64>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?; + let param_before = query_params + .get("before") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<chrono::DateTime<chrono::Utc>>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected UTC datetime in ISO/RFC format)".to_string())))?; + let param_since = query_params + .get("since") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<chrono::DateTime<chrono::Utc>>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected UTC datetime in ISO/RFC format)".to_string())))?; match api.get_editor_annotations(param_editor_id, param_limit, param_before, param_since, context).wait() { Ok(rsp) => match rsp { @@ -4512,8 +4597,15 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok()); + let param_autoaccept = query_params + .get("autoaccept") + .and_then(|list| list.first()) + .and_then(|x| Some(x.to_lowercase().parse::<bool>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?; let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for @@ -4540,7 +4632,10 @@ where }; let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?; - match api.create_file_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() { + match api + .create_file_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context) + .wait() + { Ok(rsp) => match rsp { CreateFileBatchResponse::CreatedEntities(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -5087,7 +5182,12 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok()); + let param_limit = query_params + .get("limit") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<i64>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?; match api.get_file_history(param_ident, param_limit, context).wait() { Ok(rsp) => match rsp { @@ -5739,8 +5839,15 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok()); + let param_autoaccept = query_params + .get("autoaccept") + .and_then(|list| list.first()) + .and_then(|x| Some(x.to_lowercase().parse::<bool>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?; let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for @@ -5767,7 +5874,10 @@ where }; let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?; - match api.create_fileset_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() { + match api + .create_fileset_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context) + .wait() + { Ok(rsp) => match rsp { CreateFilesetBatchResponse::CreatedEntities(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -6314,7 +6424,12 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok()); + let param_limit = query_params + .get("limit") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<i64>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?; match api.get_fileset_history(param_ident, param_limit, context).wait() { Ok(rsp) => match rsp { @@ -6884,8 +6999,15 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok()); + let param_autoaccept = query_params + .get("autoaccept") + .and_then(|list| list.first()) + .and_then(|x| Some(x.to_lowercase().parse::<bool>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?; let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for @@ -6912,7 +7034,10 @@ where }; let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?; - match api.create_release_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() { + match api + .create_release_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context) + .wait() + { Ok(rsp) => match rsp { CreateReleaseBatchResponse::CreatedEntities(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -7791,7 +7916,12 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok()); + let param_limit = query_params + .get("limit") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<i64>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?; match api.get_release_history(param_ident, param_limit, context).wait() { Ok(rsp) => match rsp { @@ -8151,11 +8281,25 @@ where let param_pmid = query_params.get("pmid").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); let param_pmcid = query_params.get("pmcid").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); let param_core_id = query_params.get("core_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_arxiv_id = query_params.get("arxiv_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_jstor_id = query_params.get("jstor_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); let param_expand = query_params.get("expand").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); let param_hide = query_params.get("hide").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); match api - .lookup_release(param_doi, param_wikidata_qid, param_isbn13, param_pmid, param_pmcid, param_core_id, param_expand, param_hide, context) + .lookup_release( + param_doi, + param_wikidata_qid, + param_isbn13, + param_pmid, + param_pmcid, + param_core_id, + param_arxiv_id, + param_jstor_id, + param_expand, + param_hide, + context, + ) .wait() { Ok(rsp) => match rsp { @@ -8542,8 +8686,15 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok()); + let param_autoaccept = query_params + .get("autoaccept") + .and_then(|list| list.first()) + .and_then(|x| Some(x.to_lowercase().parse::<bool>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?; let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for @@ -8570,7 +8721,10 @@ where }; let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?; - match api.create_webcapture_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() { + match api + .create_webcapture_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context) + .wait() + { Ok(rsp) => match rsp { CreateWebcaptureBatchResponse::CreatedEntities(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -9117,7 +9271,12 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok()); + let param_limit = query_params + .get("limit") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<i64>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?; match api.get_webcapture_history(param_ident, param_limit, context).wait() { Ok(rsp) => match rsp { @@ -9541,8 +9700,15 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_autoaccept = query_params.get("autoaccept").and_then(|list| list.first()).and_then(|x| x.parse::<bool>().ok()); + let param_autoaccept = query_params + .get("autoaccept") + .and_then(|list| list.first()) + .and_then(|x| Some(x.to_lowercase().parse::<bool>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected boolean)".to_string())))?; let param_editgroup_id = query_params.get("editgroup_id").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_description = query_params.get("description").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_extra = query_params.get("extra").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for @@ -9569,7 +9735,10 @@ where }; let param_entity_list = param_entity_list.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity_list".to_string())))?; - match api.create_work_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, context).wait() { + match api + .create_work_batch(param_entity_list.as_ref(), param_autoaccept, param_editgroup_id, param_description, param_extra, context) + .wait() + { Ok(rsp) => match rsp { CreateWorkBatchResponse::CreatedEntities(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -10116,7 +10285,12 @@ where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = req.get::<UrlEncodedQuery>().unwrap_or_default(); - let param_limit = query_params.get("limit").and_then(|list| list.first()).and_then(|x| x.parse::<i64>().ok()); + let param_limit = query_params + .get("limit") + .and_then(|list| list.first()) + .and_then(|x| Some(x.parse::<i64>())) + .map_or_else(|| Ok(None), |x| x.map(|v| Some(v))) + .map_err(|x| Response::with((status::BadRequest, "unparsable query parameter (expected integer)".to_string())))?; match api.get_work_history(param_ident, param_limit, context).wait() { Ok(rsp) => match rsp { |