aboutsummaryrefslogtreecommitdiffstats
path: root/rust/fatcat-openapi/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/fatcat-openapi/src/lib.rs')
-rw-r--r--rust/fatcat-openapi/src/lib.rs55
1 files changed, 52 insertions, 3 deletions
diff --git a/rust/fatcat-openapi/src/lib.rs b/rust/fatcat-openapi/src/lib.rs
index 4fe878e1..686cd84e 100644
--- a/rust/fatcat-openapi/src/lib.rs
+++ b/rust/fatcat-openapi/src/lib.rs
@@ -563,6 +563,18 @@ pub enum GetEditorEditgroupsResponse {
}
#[derive(Debug, PartialEq)]
+pub enum LookupEditorResponse {
+ /// Found
+ Found(models::Editor),
+ /// Bad Request
+ BadRequest(models::ErrorResponse),
+ /// Not Found
+ NotFound(models::ErrorResponse),
+ /// Generic Error
+ GenericError(models::ErrorResponse),
+}
+
+#[derive(Debug, PartialEq)]
pub enum UpdateEditorResponse {
/// Updated Editor
UpdatedEditor(models::Editor),
@@ -1383,6 +1395,9 @@ pub trait Api {
fn lookup_container(
&self,
issnl: Option<String>,
+ issne: Option<String>,
+ issnp: Option<String>,
+ issn: Option<String>,
wikidata_qid: Option<String>,
expand: Option<String>,
hide: Option<String>,
@@ -1469,6 +1484,8 @@ pub trait Api {
context: &Context,
) -> Box<dyn Future<Item = GetEditorEditgroupsResponse, Error = ApiError> + Send>;
+ fn lookup_editor(&self, username: Option<String>, context: &Context) -> Box<dyn Future<Item = LookupEditorResponse, Error = ApiError> + Send>;
+
fn update_editor(&self, editor_id: String, editor: models::Editor, context: &Context) -> Box<dyn Future<Item = UpdateEditorResponse, Error = ApiError> + Send>;
fn create_file(&self, editgroup_id: String, entity: models::FileEntity, context: &Context) -> Box<dyn Future<Item = CreateFileResponse, Error = ApiError> + Send>;
@@ -1560,6 +1577,7 @@ pub trait Api {
doaj: Option<String>,
dblp: Option<String>,
oai: Option<String>,
+ hdl: Option<String>,
expand: Option<String>,
hide: Option<String>,
context: &Context,
@@ -1649,6 +1667,9 @@ pub trait ApiNoContext {
fn lookup_container(
&self,
issnl: Option<String>,
+ issne: Option<String>,
+ issnp: Option<String>,
+ issn: Option<String>,
wikidata_qid: Option<String>,
expand: Option<String>,
hide: Option<String>,
@@ -1724,6 +1745,8 @@ pub trait ApiNoContext {
since: Option<chrono::DateTime<chrono::Utc>>,
) -> Box<dyn Future<Item = GetEditorEditgroupsResponse, Error = ApiError> + Send>;
+ fn lookup_editor(&self, username: Option<String>) -> Box<dyn Future<Item = LookupEditorResponse, Error = ApiError> + Send>;
+
fn update_editor(&self, editor_id: String, editor: models::Editor) -> Box<dyn Future<Item = UpdateEditorResponse, Error = ApiError> + Send>;
fn create_file(&self, editgroup_id: String, entity: models::FileEntity) -> Box<dyn Future<Item = CreateFileResponse, Error = ApiError> + Send>;
@@ -1814,6 +1837,7 @@ pub trait ApiNoContext {
doaj: Option<String>,
dblp: Option<String>,
oai: Option<String>,
+ hdl: Option<String>,
expand: Option<String>,
hide: Option<String>,
) -> Box<dyn Future<Item = LookupReleaseResponse, Error = ApiError> + Send>;
@@ -1938,11 +1962,14 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> {
fn lookup_container(
&self,
issnl: Option<String>,
+ issne: Option<String>,
+ issnp: Option<String>,
+ issn: Option<String>,
wikidata_qid: Option<String>,
expand: Option<String>,
hide: Option<String>,
) -> Box<dyn Future<Item = LookupContainerResponse, Error = ApiError> + Send> {
- self.api().lookup_container(issnl, wikidata_qid, expand, hide, &self.context())
+ self.api().lookup_container(issnl, issne, issnp, issn, wikidata_qid, expand, hide, &self.context())
}
fn update_container(&self, editgroup_id: String, ident: String, entity: models::ContainerEntity) -> Box<dyn Future<Item = UpdateContainerResponse, Error = ApiError> + Send> {
@@ -2061,6 +2088,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> {
self.api().get_editor_editgroups(editor_id, limit, before, since, &self.context())
}
+ fn lookup_editor(&self, username: Option<String>) -> Box<dyn Future<Item = LookupEditorResponse, Error = ApiError> + Send> {
+ self.api().lookup_editor(username, &self.context())
+ }
+
fn update_editor(&self, editor_id: String, editor: models::Editor) -> Box<dyn Future<Item = UpdateEditorResponse, Error = ApiError> + Send> {
self.api().update_editor(editor_id, editor, &self.context())
}
@@ -2219,11 +2250,29 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> {
doaj: Option<String>,
dblp: Option<String>,
oai: Option<String>,
+ hdl: Option<String>,
expand: Option<String>,
hide: Option<String>,
) -> Box<dyn Future<Item = LookupReleaseResponse, Error = ApiError> + Send> {
- self.api()
- .lookup_release(doi, wikidata_qid, isbn13, pmid, pmcid, core, arxiv, jstor, ark, mag, doaj, dblp, oai, expand, hide, &self.context())
+ self.api().lookup_release(
+ doi,
+ wikidata_qid,
+ isbn13,
+ pmid,
+ pmcid,
+ core,
+ arxiv,
+ jstor,
+ ark,
+ mag,
+ doaj,
+ dblp,
+ oai,
+ hdl,
+ expand,
+ hide,
+ &self.context(),
+ )
}
fn update_release(&self, editgroup_id: String, ident: String, entity: models::ReleaseEntity) -> Box<dyn Future<Item = UpdateReleaseResponse, Error = ApiError> + Send> {